Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2045
delete row on client
posted

I use to have this code for ver 10.2 to delete row in grid without do async call.

========================

var selected = igtbl_getGridById("UltraWebGrid1");
var row = selected.getActiveRow();

var index = row.getIndex();
var rows = row.OwnerCollection;

rows.remove(index, false);

That was working!

============================

Now I am using ver 14.2 and try to rewrite this to

====================== 

var grid = $find('<%= UltraWebGrid1.ClientID %>');

var gridRows = grid.get_rows();

var selectedRows = grid.get_behaviors().get_selection().get_selectedRows();

var rows = new Array();

var i1 = 0;

for (var i = selectedRows.get_length() - 1; i >= 0; i--) {

rows[i1] = selectedRows.getItem(i);
i1++;
}

grid.get_behaviors().get_editingCore().get_behaviors().get_rowDeleting().deleteRows(rows);

=======================================

I have error on last line: Async request failed.

I don't want to post to the server, I want remove row from grid. 

Please help. Thanks