Grid with Paging and updateFromXML

Are grids with paging compatible with .updateFromXML() ?

I as as the difficulty I am having at the moment is as follows:

Setup:

var dhxGridb; dhxGridb = dhxLayout.cells("b").attachGrid(); var sb_b = dhxLayout.cells("b").attachStatusBar(); sb_b.setText("<div id='recinfoArea'></div>"); dhxGridb.setPagingWTMode(true,true,false,true); dhxGridb.enablePaging(true, 100, null, "recinfoArea"); dhxGridb.setPagingSkin("toolbar", "dhx_skyblue") dhxGridb.loadXML("fl.php?requestHeader=1"); dhxGridb.attachEvent("onXLE", function(grid_obj,count){ dhxGridb.setSizes(); });

All works well, no issues, the columns, etc. are configured in the XML generated server side. By virtue of the requestHeader parameter, the required info is sent the first time. An example of the return:

[code]



true
1


true
ui-state-highlight













</head>

… row data, etc… [/code]

Further requests to the file do not send the config data, only the row data as prescribed:

<rows total_count='600' pos='100'>
        <row id="695" >
...... etc, etc

Again all works well, can page through the grid, everything as usual.
Data is changed up, so we need to refresh something. The following code is used:

var xml_loc = "fl.php?requestHeader=0&posStart="+state[1];
dhxGridb.updateFromXML(xml_loc, true, true);

If this is done on page 1, everything is great…

Lets say were on page 2 (anything accept from page 1)
The request is sent, page comes back, all is well referencing FireBug:

Then requests continue to cycle XML requests from posStart=199, then posStart=198, etc. etc.

If I change up the refresh code to:

var xml_loc = "fl.php?requestHeader=0&posStart="+state[1];
dhxGridb.clearAndLoad(xml_loc);

or

var xml_loc = "fl.php?requestHeader=0&posStart="+state[1];
dhxGridb.clearAll();
dhxGridb.updateFromXML(xml_loc, true, true);

The recursive XML calling does not occur, however even though the XML comes back as it should:

<rows total_count='600' pos='200'>

The grid rec info area shows count 1-100 and no pages

It is not safe to use updateFromXML in case of dyn. loading ( it will add new rows, instead of filling not-loaded spaces, which will shift order of other rows and will introduce other potential problems )

dhxGridb.clearAndLoad(xml_loc);
This one can must work correctly, try to change it as

dhxGridb.clearAndLoad(xml_loc, function(){ dhxGridb.changePage(dhxGridb.currentPage); })

The issue is doing clearAndLoad() pulls back 2 XML calls for data. I see the first one in FB pcome as required from My Call:

then immediatly after a second request for the first page

^ the second page requested is being called internally by the grid??? It has the “count” parameter in the data request, so it is being requested by the grid itself for some reason.

It is caused by logic of grid, which always starting rendering from the start of grid. So it will always request first page of data after reloading.

Does it cause some side effects , except of loading two pages of data ?

well it would be nice to be able to refresh the data on screen without forcing the user to go back to page one.