Javascript PHP JqGrid中行编辑上的自动增量字段?
在PHP的Javascript PHP JqGrid中行编辑上的自动增量字段?,javascript,php,jqgrid,jqgrid-php,Javascript,Php,Jqgrid,Jqgrid Php,在PHP的JqSuite中,我试图在每次提交行编辑时自动增加字段值。 但我的代码不起作用 grid.php摘录: $custom = <<<CUSTOM var rowId; var keys, oneditfunc, succesfunc, url, extraparam, errorfunc, afterrestorefunc; function aftersavefunc(rowId, response) { alert("aftersavefunc Fire
JqSuite
中,我试图在每次提交行编辑时自动增加字段值。
但我的代码不起作用
grid.php摘录:
$custom = <<<CUSTOM
var rowId;
var keys, oneditfunc, succesfunc, url, extraparam, errorfunc, afterrestorefunc;
function aftersavefunc(rowId, response) {
alert("aftersavefunc Fired!");
alert(rowId);
$("#grid").jqGrid('setCell', rowId, 'revision', '3');
}
jQuery("#grid").jqGrid('editRow', rowId, keys, oneditfunc,
succesfunc, url, extraparam, aftersavefunc, errorfunc, afterrestorefunc);
CUSTOM;
$custom=我找到了问题的解决方案:我只需要使用:
$cid = jqGridUtils::GetParam('my_id');
$grid->setAfterCrudAction('edit', "UPDATE my_table SET revision = revision + 1 WHERE my_id=?",array($cid));