Re-sorting after inserting/deleting rows
Is there a way of maintaining the grid sort after inserting or deleting rows. I have tried using the following code but it does not work.
Thanks in advance for any help.
Thanks in advance for any help.
function addRow()
{
var rowData = ["1", "2", "3", "4", "5"];
myData.push(rowData);
// re-initialize the data values
obj.setDataProperty("count", myData.length);
// re-initialize the row values
var newCount = obj.getDataProperty("count");
var rowValues = [];
var sort_value = obj.getSortProperty("index");
for(var i=0; i < newCount; ++i) { rowValues[i] = i; }
obj.setRowProperty("values", rowValues);
obj.setSortProperty("index", -1);
obj.setSortProperty("index", sort_value);
// refresh the grid
obj.refresh();
}
Rag!
February 26,