I need set some rows as selected when datagrid is load, How can I do it?
In php, you can connect onload event. (refer demo/editing/custom-event)
$e["js_on_load_complete"] = "do_onload";
Then can use following JS code to select rows.
var ids = jQuery('#list1').jqGrid('getDataIDs'); // this is array of all ids.
jQuery('list1').jqGrid('setSelection',5); // here 5,6,7 are rows ids (first col value)
How useful was this discussion?
Click on a star to rate it!
Average rating / 5. Vote count:
We are sorry that this post was not useful for you!
Let us improve this post!
Thanks for your feedback!