Hi,
Does anyone know how to do a client side resort of the WebDataGrid?
Thank Yoou,
Tracy
Hi Tracy,
This should be fairly easy to accomplish. Just use the following code.
var grid = $find("WebDataGrid1");
var sorting = grid.get_behaviors().get_sorting();
var col = grid.get_columns().get_column(0);
sorting.sortColumn(col, 1, true); // first param is col object, second is sort direction (0-none, 1- asc, 2-desc) and last param is whether to clear other columns' sortings
sorting.applySort();
Let us know if you have any other trouble.
regards,David Young
I have a problem. The thing is that suppose if we sort a column and if I want to display the data in grid as it was there before (the sorting of column) in a button's client side click then how can I achieve it? Is it possible? If so how?
Thanks & regards,
Assyst
Hi David,
Thanks for the reply. but I fon't think that does what I want. Doesn't the applySort do a postback to the server? What I want to do is waht you can do with the UltraWebGrid:
var grid = igtbl_getGridById("UltraWebGrid1");
grid.sort();
THis resorts the grid on the client side without doing a postback. Is that possible?
Thanks,Tracy