Closed duyloc91 closed 9 years ago
You can save/export the complete layout of all open jsPanels to localStorage and later import/restore this layout again.
Please take a look at http://jspanel.de/documentation/exportPanels.html where you can find a complete example how to do this.
Beside this you can access almost all panel data via the panel property option like:
var test = $.jsPanel();
console.log(test.option);
More questions? Don't hesitate to ask ...
Thanks man, I have another question related to this. How can I detect user changes to the panels so that I can export the current panels into localstorage? The reason is that beforeunload doesn't work on all browsers.
You're welcome ... Well, concerning panel status you could use the built in jsPanel events like jspanelmaximized, jspanelminimized and so on. For size and position I recommend the jQuery UI events. See
But from a users point of view ... Wouldn't it be better to privide a menu item like Save Layout Now for example. So the user could decide himself which layout he wants to save.
Agree, I was thinking about a button as well. Did anyone report a flicker effect when using jsPanel.exportPanels() on Chrome before? On Firefox it works perfectly.
No, I don't have such a report yet. But there's only one other project using jsPanel.exportPanels() I know of anyhow. And that's still in developement - http://chat.linux.uk/
Is there anyway in which I can retrieve an panel's current size? I would like my web application to save user's preferences of panels' size into localstorage so users don't have to adjust the panels every visit.