How do I best remove a row?
Hi,
I'm trying to learn how to delete rows from the grid. Here is my code...
function remove_row() {
if (obj.getSelectionProperty("index") != -1) {
data.splice(obj.getSelectionProperty("index"), 1);
num_rows--;
obj.setRowProperty("count", num_rows);
obj.setDataProperty("text", function(i, j){return data[i][j]});
obj.refresh();
}
}
This works fine, until the row order gets changed by sorting. Then the line with the call to setDataProperty returns an error that "data[..] is null or not an object." I'm not sure what to do, any help would be greatly appreciated. Thanks.
Sincerely,
Mike
I'm trying to learn how to delete rows from the grid. Here is my code...
function remove_row() {
if (obj.getSelectionProperty("index") != -1) {
data.splice(obj.getSelectionProperty("index"), 1);
num_rows--;
obj.setRowProperty("count", num_rows);
obj.setDataProperty("text", function(i, j){return data[i][j]});
obj.refresh();
}
}
This works fine, until the row order gets changed by sorting. Then the line with the call to setDataProperty returns an error that "data[..] is null or not an object." I'm not sure what to do, any help would be greatly appreciated. Thanks.
Sincerely,
Mike
someguy
January 27,