Layout Dettach?

Is There a dettachObject type of functionality for the layout object?



After attaching ab object:



dhxLayout.cells(“c”).attachObject(“panel_add_edit_designgrid_sql”);



then replacing the content later:



dhxLayout.cells(“c”).attachHTMLString(“




No Field Selected
”);



When trying to reattach:



dhxLayout.cells(“c”).attachObject(“panel_add_edit_designgrid_sql”);



The following error is caught:



uncaught exception: [Exception… “Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER)” nsresult: “0x80004003 (NS_ERROR_INVALID_POINTER)” location: “JS frame :: cms.local/_components/dhtmlxLayo … ntainer.js :: anonymous :: line 13” data: no]


When you call dhxLayout.cells(“c”).attachHTMLString(“




No Field Selected
”); the previous cell content is removed, so panel_add_edit_designgrid_sql container doesn’t exist any more.


You can replace panel_add_edit_designgrid_sql to the body for example, hide it and attached again when it’s necessary:


document.body.appendChild(document.getElementById(" panel_add_edit_designgrid_sql"));


document.getElementById(" panel_add_edit_designgrid_sql").style.display = “none”;


dhxLayout.cells(“c”).attachHTMLString(“



No Field Selected
”);