:: Forum >>

Refreshing the grid with AJAX

Is possible to reload the grid without reloading the HTML page?
I have an AJAX function that returns and loads new js array.
Grid is already rendered on the page.
How to reload this grid with new data?
Boris
Monday, July 2, 2007
If it is the same dataset with the changed data - just call refresh() method. There is also an example with 'realtime' updates which calls refresh only for the changed cells in /examples/grid data - realtime/quotes.htm

If you want to replace the data with the different set - call clear(), re-initialize the grid, then call refresh() to repaint.
Alex (ActiveWidgets)
Monday, July 2, 2007
Thanks, Alex
I used the following function:

function loadGrid(arrData, resetScroll)
{
obj.setSelectedRows([-1]);
obj.setCurrentRow(-1);
obj.clearRowModel();
obj.setRowCount(arrData.length);

if (resetScroll)
obj.setScrollTop(0);

obj.refresh();

if (arrData.length > 0)
obj.setCellData(arrData);
}//--> end function
Boris
Wednesday, September 12, 2007
so did it work?
Wednesday, September 12, 2007

This topic is archived.


Back to support forum

Forum search