Need A Return From dhtmlxGrid Using A dhtmlxLayout Panel

I want to use dhtmlxGrid in a dhtmlxLayout Panel.



I successfully use Php to create HTML complete with Grid loading using XML. This works fine stand-alone. I can click on a button and return anything from the Grid I choose.



Now I try to attach this same Grid using

dhxLayout.cells(‘d’).attachURL(’…/Folder/PhpFile.php?x=’+blah);

The Grid appears and operates the same as stand-alone.

But I cannot get any return to the calling js underlying the dhtmlxLayout.



So I have also tried attaching a DIV to the Panel using

document.body.appendChild(divTag);

This one will report back to the calling js underlying the dhtmlxLayout.

But in this case the Grid doesn’t load althought the full HTML is written in the new DIV.



So I seem stuck between these two worlds. How do I attach the Php/XML-built Grid to the Panel and still have the data return to the calling JS for further processing?


Hello,


The same issue was already discussed on our forum. Please, take a look:


dhtmlx.com/docs/products/kb/inde … mal&q=9031


OK. Very interesting. I can use this elsewhere. Thanks! But quite different from what I am asking.


Let me rephrase the entire question. This time using one of your sample Grids. – dhtmlxGrid/samples/initialization_loading/grid_xml_formats.html


I add the following single line of code just beneath your own <div id=“gridbox” …




In my miracleClass.js I deploy the following url load: – dhxLayout.cells(‘a’).attachURL(‘dhtmlxGrid/samples/initialization_loading/grid_xml_formats.html’); with my added Button.


Also inside my miracleClass.js I have – function receiveGodLikeMessageFromLayoutA(powerfulMessage) { alert('Your Powerful Message Was: '+powerfulMessage); }


Clicking the Button should return “Alice in Wonderland” to my miracleClass.js. But instead I throw an error because it can’t find the function receiveGodLikeMessageFromLayoutA() in my miracleClass.js.

How do I accomplish this simple task?


Larry





As the page dhtmlxGrid/samples/initialization_loading/grid_xml_formats.html is inside iframe. receiveGodLikeMessageFromLayoutA function must be called from iframe:


parent.receiveGodLikeMessageFromLayoutA(powerfulMessage);


Now that worked just fine! Simple “duhs” for simple minds… Thanks so much! – Larry