Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on May 22, 2007 09:10
open dhtmlx forum
Does SCAND grid support parsing of responseXML object directly

Hi,

I've been evaluating your product last days and I created a sortable grid based on an XML file. Now I am wondering about another situation. For example I am accessing a page using Ajax that returns the content in XML format and stored in the responseXML property of my Ajax request object.

Is it possible to directly create a grid table based on the content in responseXML object of the Ajax request object?

In this case there is no XML file storage XML content will be created by the server-side as and when there is a client request.

Please give me more information about this kind of transactions.

Thanks in advance

Jones
Answer posted on May 22, 2007 14:03
The grid can use xmlHttpRequest object with XML response as datasource
    grid.parseXML(my_object);

Please beware that such init may not work correctly for paging and smart-rendering modes.

>>In this case there is no XML file storage XML content will be created by the server-side
The default grid.loadXML(... operation, doesn't require that target must be a static XML file, it can be any server-side script which generates valid XML response
Answer posted by Scott on Jun 05, 2007 19:31
Just confirmed that parseXML(myDomObject)  breaks smart rendering.
Answer posted by Scott on Jun 05, 2007 19:56
I would just like to add that it would be great if parseXML(my_object) supported smart rendering. It seems there's no reason why not. LoadXML from a file, loads the entire xml and then does it's work, why can't parseXML(my_object) do that same thing?
Answer posted on Jun 06, 2007 10:29
Currently the loadXML used as main data loading routine, the parseXML is only parser part without any relation to other grid's logic, its ability to load directly from XML object just a documented side effect, not the prime functionality, it will not work in dynamically loading modes ( it will work for initial loading, but all subsequent loading attempts will be run through native loadXML routine )

In case of smart Rendering - the logic build in such way that grid logic itself initiate loading when necessary, so there is not way to use parseXML in such circumstances.
Answer posted by Scott on Jun 08, 2007 18:03
Ok. This makes sense.  Here is the work around that your support guys sent me via email, which seems to only work in the latest release:

       //load it in Smart Render  mode
        var loader = new dtmlXMLLoaderObject();
        loader.xmlDoc=this.XMLContent;
        grid._dl_start=[[0,grid._dloadSize]];
        grid._askRealRows2(grid,loader,null,null,loader);



Answer posted by radyno (Support) on Dec 11, 2014 12:50

Not much can be said in addition to the reply above, but you also can check ajax text edit and menu tree javascript and find out what we have probably missed in our explanation.