}).navGrid("#DashboardPager", { edit: false, add: false, del: false ,save:false}, {}, {}, {}, { modal: true, multipleSearch: true })
$grid.jqGrid('inlineNav', '#DashboardPager', {
onClickButton: function () {
debugger;
edit: true;
add: false;
del: false;
cancel: true;
save: false;
editParams: {
keys: false;
};
addParams: {
keys: false;
}
},
}),
$grid.navButtonAdd('#DashboardPager', {
buttonicon: "ui-icon-disk",
jsonReader: "{repeatitems:false}",
onClickButton: function (rowId) {
var selRowId = null;
var myGrid = $('#DashboardTable'),
selRowId = myGrid.jqGrid('getRowData', rowId);
var Project_ID = selRowId['PROJECT_ID'];
var Status = selRowId['PROJECT_STATUS'];
$.ajax({
type: "POST",
data: "{projectID:'" + projectID + "', Status:'" + Status + "'}",
url: "Home.aspx/Operation",
contentType: "application/json; charset=utf-8",
dataType: "json",
});
},
title: "Export to Excel with Filter",
position: "first"
});
}
答案 0 :(得分:0)
没有rowId
方法的onClickButton
回调的navButtonAdd
参数。我建议您使用
var rowId = myGrid.jqGrid("getGridParam", "selrow");
在onClickButton
回调的代码内以获取当前选定行的ID。