I am trying to use multiselect functionality in jqgrid to select multiple rows and pass it to the controller. I have created a button as follows but when I select the rows and click the button, the click button event was not fired. I am guessing I am passing wrong parameter to the function. Below is javascript code...
$("#request").jqGrid('navButtonAdd', '#requestpager',
{ caption: "Add", buttonicon: "ui-icon-info", title: "Add", //position: "first",
onClickButton: function (ids) {
var grid = $("#request");
var rowids = grid.jqGrid('getGridParam', 'selarrrow');
var count = rowids.length;
var rowData, colData;
for (var i = 0; i < count; i++) {
rowData = $("#request").getRowData(rowids[i]);
colData = rowData.Name;
}
jQuery("#request").jqGrid({ url: "/Home/Create/" + colData });
Does anyone has any suggestion of what I am doing wrong?
well its not difficult to implement multiselect in jqgrid, I'll give you a working example which i'd implemented in my project.
HTML
in your JqGrid just enable multiselect: true
and write this javascript function
and you controller method will lok like this
I hope this helps, its a working example...
P.S- please mark it as answer if it helped you.