Hello, I need to know how to make a new row that is added to the end of the grid, take the focus, that is, be the “selected” one? I am not using pagination and $grid[“scroll”] = true.
Once I add the row (in mysql), I update the grid with:
jQuery(‘#lstGrid’).trigger(‘reloadGrid’,[{jqgrid_page:1}]);
but the following code does not work:
setTimeout(function(){
$(“#lstGrid”).jqGrid(‘setSelection’, new_row_id );
}, 500);
Thanks for the help!
1 Answers
Apparently, It seems like the new_row_id is not in the displayed listing to be selected.
One option is to sort the grid descending with row_id so the new row will be shown first and after that selection should work as expected.
I think It will work without setSelection as well in above solution.
Your Answer