DHTMLX Error on dock [ing] an undocked cell
-
21-12-2019 - |
Question
I am having trouble getting an undocked cell in DHTMLX 4 to dock.
When I click on the provided "dock" button(on the undocked cell) I get the error:
Uncaught TypeError: Cannot read property 'close' of null
I also get this same error when assigning the .dock()
function to another button.
onclick: function ()
{// where to undock to _this.dhxLayout.dhxWins.attachViewportTo("layout_div"); // init & undock window var popup_cell = _this.dhxLayout.cells("c"); popup_cell.undock(0,0,800,600); var popup_window = _this.dhxLayout.dhxWins.window("c"); popup_window.button("minmax1").hide(); popup_window.setText(" "); // things to do when window is opened popup_cell.attachEvent("onUnDock", alert("undocked")); // assigning .dock() to another button, neither work popup_window.button("park").attachEvent("onClick", function(popup_window){_this.dhxLayout.cells("c").dock();}); // popup_window.button("park").attachEvent("onClick", function(popup_window){popup_cell.dock()}); }
The traceback takes me to c=this.layout.dhxWins.window(this.conf.name);c.close();
so I am guessing that c
is somehow undefined? Is there an argument/parameter I am supposed to be passing in the .dock(foo)
? The API shows no examples with it.
Any help is greatly appreciated!
La solution
I missed out on this: http://forum.dhtmlx.com/viewtopic.php?f=5&t=37052
And followed it to change the offending line of:
c=this.layout.dhxWins.window(this.conf.name);c.close();
(in dhtmlx.js) to
c=g.dhxWins.window(this.conf.name);c.close();
and the problem is fixed!