OK, so in my application the colModel is already prepared and I'm adding multiselect: true using setGridParam as below.
jQuery(document).ajaxComplete(function () {
var grid = jQuery('#grid');
grid.jqGrid('setGridParam', {
multiselect: true
}
});
This seems to work only partially and highlights the rows when selected. However, I'm not getting the first multiselect checkbox column. Is there an additional setting required for it.
I referred to the below examples in which the checkbox column is rendered.
http://www.guriddo.net/demo/guriddojs/selection/checkbox/index.html
The multiselect option can't be set dynamically. You can easy determine which parameter in jqGrid can be changed dynamically if you look at the last column in the options table - Can be Changed?. See the docs here.
To make this work I recommend you to do some trick.
At grid creation use multi select true to enable multiselection. Immediate after creation the grid hide the multiselect column.
When you need to enable the multiselection dynamically just show the column. The name of multi select column is combination of cb_ plus the id of the grid. The code can look like this: