DHTMLX Grid

Hi,

How to make the dynamic requests for the mygrid.parse("xmldata","xml") instead of the

mygrid.load("/load.xml");

I mean how to load the data from the xml string when the page loads and then when we click the next page it should load. But its not loading up on clicking the next page.

There is no way to parse data dynamically from xml string.

Hi,

I mean first time use the parse method on the grid initialization.
Then it should automatically use the mygrid.load(url) method.

If you want load data dynamically, you should use load() method.

Hi,

Is it not possible to use mygrid.parse(xmldata, xml) on the page load then on the onDynXLS is it not possible to use the mygrid.load(url)

Hi;

İ think you want your grid first load settings XML after data XML;

İf you want this that is possible but no only dhtmlxGrid function.

Solutions

var myGrid;
function createGrid(containerId){
      var myGrid = new dhtmlXGridObject(containerId);
      myGrid.loadXML("gridTemplater.php?gridId=1"); 
      myGrid.init();
}

function dataLoadGrid(){
      var ajx = .........
........................
      ..............
      myGrid.parse(ajx.responseText);
}

Step 1 . Grid Created Configuration From XML
Step 2 . Create Custom HTTPRequest
Step 3 . MyGrid Parse ResponseText from HttpResponse.

Hi,

I don’t want to use the ajax request on the load instead i am parsing the xmldata from the div.
mygrid.parse(document.getElementById(‘xml_id’).innerHTML,“xml”);

Then dynamically i want to use the mygrid.load

I have solved this problem with following approach. Hope it can be used for you:

  1. On server side, create a handler for DHTMLXGrid open procedure (“ReloadData”, for example) which executes the sql statement (may use LIMIT clauses, if necessary)

  2. Create another server procedure ("SendOpen, for example) that “sends an event to client” forcing the execution of “open” procedure and, of couse, the “ReloadData” on server.

  3. On server side, whenever you need to start population of grid, exec SendOpen.

  4. Automatic paging will occurs normally through “open” on client and “ReloadData” on server.

Hope this helps.