更新时间:2023-12-05 12:33:16
首先successfunc
的值应该是函数而不是字符串(请参见当前代码"successfunc":"..."
)
First of all the value of successfunc
should be the function and not the string (see in your current code "successfunc":"..."
)
我建议您尝试将相同的设置添加到addParams.addRowParams
和inlineNav
的editParams
选项中.此外,我建议您将$(this).trigger("reloadGrid")
从successfunc
放入setTimeout
的内部,以确保在标准的行保存处理后 开始重新加载.
I would recommend you to try to add the same settings to both addParams.addRowParams
and to editParams
options of inlineNav
. Moreover I would recommend you to place $(this).trigger("reloadGrid")
from successfunc
inside of setTimeout
to be sure that reloading will be started after the standard processing of saving of the row.
所以代码可能与以下内容有关:
So the code could be about the following:
var editOptions = {
keys: true,
successfunc: function () {
var $self = $(this);
setTimeout(function () {
$self.trigger("reloadGrid");
}, 50);
}
};
$("#mygrid").jqGrid("inlineNav", "#mygrid_pager1", {
addParams: {
position: "last",
addRowParams: editOptions
},
editParams: editOptions
});