Hello jqWidgets gurus,
I’m currently using jqxDocking and it’s being a bit of a pain. Basically, I have a bunch of windows that the user can chose to close. When a window is closed I send a signal to the server so it remembers that it’s closed and hence won’t load the window on a refresh.
The problem is, that closing a window, then calling ‘exportLayout’ the closed window is still included in the layout. This means that on a page reload the layout throws an “Invalid JSON string” error alert which is annoying my users.
I then tried calling a remove() on the window once it is closed, then calling ‘exportLayout’ which then returns for real invalid JSON. In my case:
{"panel0": {"arms_widget":{"collapsed":false},"pms_widget":{"collapsed":false}},"panel1": {},"panel2": {"phonelist_widget":{"collapsed":false},"notification_widget":{"collapsed":false}},"floating":{"calendar_widget":{"x":"555.5px","y":"168px","width":"undefined","height":"undefined","collapsed":undefined}},"orientation": "horizontal"}
The problem appears to be the “collapsed”:undefined at the end which is causing an error when I JSON.parse the string as ‘undefined’ it not a valid object.
For starters, why is the window that I have removed still being included in the exported layout? Why is it considered ‘floating’ when it no longer even exists in the DOM?
Also, why is this widget the ONLY widget in the jqWidgets suite that throws an alert? Ideally it would be nice if it just silently ignored any windows that don’t actually exist in the host DIV layout.
Jamie