Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by JL on Jul 30, 2008 09:09
open dhtmlx forum
Append XML to dhtmlxGrid

Hi,

How can I append XML data to an existing dhtmlxGrid, I use loadXML() and my table is loaded, then I want to append new data from an another XML url.

I would try something like :

        mygrid = new dhtmlXGridObject('mygrid_container');
        mygrid.init();

        // my table contains 0 line

        mygrid.loadXML("page1.php?p=1");

        // my table contains 0 + 5 lines

        mygrid.appendXML("page9.php?k=8");

        // my table contains 5 + 3 lines

But I don't find anything like appendXML() ...

Thanks for your help.
Answer posted by Support on Jul 31, 2008 02:27
If you are using dhtmlxgrid 1.5 , you can just use loadXML second time, if incoming data has not head section - it will be added to the end of existing rows.
Starting from dhtmlxgrid 1.6, grid uses more complicated logic, so you need to have additional info in xml
      mygrid.loadXML("page1.php?p=1");
          <rows>
                <row    ...5 lines here...
          </rows>

      mygrid.loadXML("page1.php?k=8");
          <rows pos="5">
                <row    ...3 lines here...
          </rows>

The pos attribute of row tag, specify from which position rows must be added to the grid