javascript - keep state of collapse and expand after page reload -


Inside the ASPX page, there are five field elements inside each field next to the mythological element, you can find table rows of several rows. You can. I've added toggling functionality to the element of each legend, so that when you click on the legend element, this table will fall or spread. The problem occurs when you reload the page, all the tables are expanded when the page is reloaded so I want to keep the status of each table. Any kind of advice would appreciate.

There are several solutions to this answer, such as the server to save the status of your table, and when Also reload the client, then redirect it back to the client. My knowledge of ASPX pages is non-existent, so I am coming with a different answer.

HTML5 web store

You can use HTML5 web storage, some information can be found here:

For example, when you have a table Expand or collapse, then it must be stored with javascript every time:

  // localStorage.setItem ("table_" + table element.rot ('id') to be set in local storage. , "Collapsed"); Get local storage from // local storage.getItem ("table _" + tableElement.attr ('id'));  

Please note that the browser running this JavaScript has to support HTML5 and when the user reloads this page on another browser, it will be decided that The user first saw the page.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -