Hi,
I need set some rows as selected when datagrid is load, How can I do it?
Thank you
1 Answers
In php, you can connect onload event. (refer demo/editing/custom-event)
$e["js_on_load_complete"] = "do_onload";
$grid->set_events($e);
Then can use following JS code to select rows.
<script>
function do_onload(id)
{
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)
jQuery('list1').jqGrid('setSelection',6);
jQuery('list1').jqGrid('setSelection',7);
}
</script>
Your Answer
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!