coderespawn / dock-spawn

Dock Spawn is a web based dock layout engine that aids in creating flexible user interfaces by enabling panels to be docked on the screen similar to Visual Studio IDE
http://dockspawn.com
MIT License
255 stars 76 forks source link

SaveState / LoadState #8

Open betrayedjinn opened 11 years ago

betrayedjinn commented 11 years ago

Hi, i think there is an problem on state saving/loading. (i use dockspawn.js) I do the following:

var json = dockManager.saveState();
dockManager.loadState(json)

There were some mistakes in code, i think i fixed them correctly but now i get: -- Splitter panel should contain atleast 2 panels.

What i am doing wrong?

My init code is as followed:

         $("#dashboard").css({ height: $(window).height() - 40, width: $(window).width() });
         $("#dockManager").css({ height: $(window).height() - 60, width: $(window).width() - 20 });
         dockManager = new dockspawn.DockManager($("#dockManager")[0]);
         dockManager.initialize();

         solution = new dockspawn.PanelContainer($("#projectExplorer")[0], dockManager);
         output = new dockspawn.PanelContainer($("#output_window")[0], dockManager);
         properties = new dockspawn.PanelContainer($("#properties_window")[0], dockManager);
         editor = new dockspawn.PanelContainer($("#codeeditor")[0], dockManager);

         documentNode = dockManager.context.model.documentManagerNode;
         editorNode = dockManager.dockFill(documentNode, editor);
         solutionNode = dockManager.dockRight(documentNode, solution, 1);
         propertiesNode = dockManager.dockDown(solutionNode, properties, .4);
         outputNode = dockManager.dockDown(documentNode, output, 0.4);

         solutionNode.container.width = 300;
         propertiesNode.container.width = 300;

         dockManager.invalidate();

Thanks.

filmackay commented 11 years ago

Yes, this part is not very well tested (in the js port). Can you provide the changes/fixes?

ghost commented 9 years ago

Could be please provide us with a simple demo describing how to save state and load state in a correct way ASAP . cause i am also facing an issue when saving and loading state ..

nixkuroi commented 7 years ago

This is still broken. Anyone ever get this working?