3.2.0

Sorting and refresh Problem

Hi Alex,

I am using the Grid Control which gets populated with data dynamically every 5 second. In between, If I sort the grid the new data within the grid should be in the sorted order. The Problem I'm currently having is that the grid gets refreshed every 5 seconds, this way I lose the previous sort state.

Listed below is my refresh method.


function refreshStatus(strData)
{
var myData = eval("[" + strData + "]");

obj.setRowProperty("count",myData.length);
obj.setDataProperty("text", function(i, j){return myData[i][j]});
// re-initialize the data values
var sindex = obj.getSortProperty("index");
var sorder = obj.getSortProperty("direction");
obj.setDataProperty("count", myData.length);
// re-initialize the row values
var newCount = obj.getDataProperty("count");
var rowValues = [];
for(var i=0; i < newCount; ++i) { rowValues[i] = i; }
obj.setRowProperty("values", rowValues);
if ( sindex != -1 && sindex != null) obj.setSortProperty("index", sindex);
if ( sorder != null) obj.setSortProperty("direction", sorder);
if (( sindex != -1 && sindex != null)&& ( sorder != null)){
obj.sort(sindex,sorder);
}
obj.refresh();
}

Can be please help me in gettting a solution to this problem?
Binu Nadesan
September 20,

This topic is archived.

See also:


Back to support forum