【发布时间】:2017-07-07 18:50:46
【问题描述】:
我正在使用 guriddo jqGrid 5.2.1
我已按照以下问题提供的答案进行操作:
- jqGrid: sending edit data
- Add additional param to post data using jqGrid when adding new row with modal form
- How to post variable data with editData or onclickSubmit in jqgrid
但是我定义的 editData 没有被发送到端点。
这是我的 jqgrid 寻呼机定义中的代码:
$('#jqGrid').navGrid('#jqGridPager',
// the buttons to appear on the toolbar of the grid
{ edit: true,
add: true,
del: true,
search: false,
refresh: false,
view: false,
position: "left",
cloneToTop: false,
mtype: 'POST',
editData: {
mediaPlanId : function() { return mpId; }
}},
// options for the Edit Dialog
{
editCaption: "Edit Item",
recreateForm: true,
checkOnUpdate : true,
checkOnSubmit : true,
closeAfterEdit: true,
errorTextFormat: function (data) {
return 'Error: ' + data.responseText;
}
},
// options for the Add Dialog
{
closeAfterAdd: true,
recreateForm: true,
errorTextFormat: function (data) {
return 'Error: ' + data.responseText;
}
},
// options for the Delete Dailog
{
errorTextFormat: function (data) {
return 'Error: ' + data.responseText;
}
}
);
mpId 在页面级别的 jqGrid 和 jqGridPager 函数之外定义。我尝试发送一个值 1,但这也不起作用。我怀疑我错过了一些简单的东西,但我不知道是什么。
【问题讨论】:
-
你用的是哪个版本?
-
感谢您指出这一点!我更新了问题以包含它。