adding a row in a sorted grid
The default behavior of the grid is to add a row at the end of the grid and scroll down to it. This does not fit the need to add a row in a sorted grid and to scroll to the newly inserted row.
I have changed the given example to sort the grid after adding a row but I am still missing how to scroll to a given row. SetScrollTop is expecting a value in pixel! Even if I get the nb of pixels by the line height (plus border?) I still would need to get the index of the row after sorting. Any clue?
obj.onRowAdded = function(row){
window.status = "Row added: " + row;
this.setCellText("new", 0, row);
var column = this.getSortColumn();
var direction= this.getSortDirection(column);
this.sort(column,direction);
}
I have changed the given example to sort the grid after adding a row but I am still missing how to scroll to a given row. SetScrollTop is expecting a value in pixel! Even if I get the nb of pixels by the line height (plus border?) I still would need to get the index of the row after sorting. Any clue?
obj.onRowAdded = function(row){
window.status = "Row added: " + row;
this.setCellText("new", 0, row);
var column = this.getSortColumn();
var direction= this.getSortDirection(column);
this.sort(column,direction);
}
Philippe Marzin
October 13,