Get selected row id's from JqGrid using jquery and pass selected id's to controller

Ankaprasad
Posted by Ankaprasad under ASP.NET MVC category on | Points: 40 | Views : 1083
function UpdateBiomarkers(){
//var bmoIds='';
var biomarkerIds=[];
var grid=jQuery("#tblBiomarkers");
var selBiomarkerIds = jQuery("#tblBiomarkers").jqGrid('getGridParam', 'selarrrow'); // selected ids

$.each(selBiomarkerIds, function (index, recordId) {
// bmoIds += grid.getRowData(selBiomarkerIds[index])["Id"] + ",";
biomarkerIds.push(grid.getRowData(selBiomarkerIds[index])["Id"]);
});
var thomsonReuterBiomarkerId=getURLParameterByName('id');

var args = {
biomarkerIds: biomarkerIds,
bmoIds:bmoIds,
thomsonReuterBiomarkerId: thomsonReuterBiomarkerId
};

$.ajax({
url: "/ThomsonReuters/UpdateBiomarkers",
dataType: "text",
type: 'POST',
data: args,
cache: false,
async: false,
success: function (data) {

},
error: function (d) {
alert('error');
}
});
}

Comments or Responses

Login to post response