Grid 2.02 xml refresh issues
I have picked through and tried all kinds of stuff and still can't get this right.
I am trying to refresh grid using xml data pull, I have tried 20 different ways and I just can't figure it out. Getting hugely frustrated...
I am running a check to see if any changes have occurred on db server, and if so I need to reload grid, but rember sort order, and selected row. There is a hidden row with selected ID, i need to be centered on the selected row after refresh. If no selected row I need to be at the top of grid.
Last thing i tried were variations of this:
// get sort properties
var sortColumn = obj.getSortColumn();
var sortDirection = obj.getSortDirection(sortColumn);
// somtimes this
table.setURL("admin_dashboard_xml.php?r="+Math.random());
table.request();
// refresh grid - sometimes this
obj.clearRowModel();
obj.setRowCount(table.getCount());
obj.refresh();
// reinstate sorting
if (sortColumn != -1) {
obj.sort(sortColumn, sortDirection);
}
Any help is much appreciated.... Also my other question several topics down about converting text to image on the fly is also kind of important.
I am trying to refresh grid using xml data pull, I have tried 20 different ways and I just can't figure it out. Getting hugely frustrated...
I am running a check to see if any changes have occurred on db server, and if so I need to reload grid, but rember sort order, and selected row. There is a hidden row with selected ID, i need to be centered on the selected row after refresh. If no selected row I need to be at the top of grid.
Last thing i tried were variations of this:
// get sort properties
var sortColumn = obj.getSortColumn();
var sortDirection = obj.getSortDirection(sortColumn);
// somtimes this
table.setURL("admin_dashboard_xml.php?r="+Math.random());
table.request();
// refresh grid - sometimes this
obj.clearRowModel();
obj.setRowCount(table.getCount());
obj.refresh();
// reinstate sorting
if (sortColumn != -1) {
obj.sort(sortColumn, sortDirection);
}
Any help is much appreciated.... Also my other question several topics down about converting text to image on the fly is also kind of important.
Chris
March 26,