How can I set the selected row (first row) on load page? I want the first row be selected in order to show the data in subgrid.
Thanks in advance
3 Answers
Following config will open the first row of subgrid on load event. You can customize as per your need.
PHP:
$e["js_on_load_complete"] = "grid_onload";
$grid->set_events($e);
JS:
function grid_onload(ids)
{
var ids = $("#list1").jqGrid('getDataIDs');
$("#list1").expandSubGridRow(ids[0]);
}
Hi. Sorry my english is very poor. I have a next code:
$g = new jqgrid();
$e["js_on_select_row"] = "do_onselect";
$g->set_events($e);
This dont work. I write the script do_onselect in <body>, but the page not show.
If iam comment the line $g->set_events($e), the contennt of page is show.
Help me.
Thanks
Your Answer