Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by husal on Nov 12, 2009 19:53
open dhtmlx forum
issue with updateFromXML dhtmlxGrid to append XML to an existing rows Grid

hi,

we are using dhtmlx 2.1 suite.

i use loadXMLString to load data into dhtmlxGrid control and later after user perform some action, i need to add new rows to dhtmlxgrid with out clearAll(false); and reload XML file.

For that, i am trying to use
updateFromXML(url, insert_new, del_missed, afterCall)

its adding new rows to Grid but if i send as XML file, but i am looking for updateFromXMLString() in dhtmlx?

How can i load a XML string insteadof XML file using updateFromXML() ?

Ref.
http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_updatefromxml

your quick reply greatly appreciated!
Answer posted by Alex (support) on Nov 13, 2009 01:40

Hello,

instead of updateFromXML() you can use following commands:

grid._refresh_mode=[true,insert_flag, delete_flag];
grid.loadXMLString(....);

Answer posted by husal on Nov 23, 2009 10:52

Thanks its working. using following code.

 SearchGrid._refersh_mode =[true,true,false];
 SearchGrid.loadXMLString(searchResultXML);

now when i use SearchGrid.getRowsNum() -> It returns me previous row count but not the updated count after loading new rows.

 

 

 

Answer posted by Alex (support) on Nov 24, 2009 07:07

We have tested the following code with the latest grid version - getRowsNum() returns correct number of rows (including new rows): 

SearchGrid._refresh_mode =[true,true,false];
SearchGrid.loadXMLString("<rows><row id='new'>.....</row></rows>");

SearchGrid.getRowsNum();

There is an issue in your code - should be _refresh_mode instead of ._refersh_mode

Answer posted on Nov 24, 2009 09:52
my bad, its working