1. Add multiselect: true
2. Get the value of the selected row
The code is as follows:
var rowData = jQuery('#List').jqGrid('getGridParam','selarrrow'); if(rowData.length) { for(var i=0;i<rowData.length;i++) { var name= jQuery('#List').jqGrid('getCell',rowData[i],'name');//name是colModel中的一属性 alert(name); } }
3. Set a row to be selected
jQuery('#List').jqGrid('setSelection','5');