编辑表单jqGrid后closeAfterEdit无法正常工作 [英] closeAfterEdit not working after editing the form jqGrid
问题描述
我正在使用jqgrid,唯一的问题是编辑后未关闭编辑"表单,而添加"表单和删除"表单已关闭并正确加载.我认为我给的选项顺序不正确,但是我尝试了不同的排列,但是没有运气.谁能看一下我的JavaScript并提供任何建议?
I am using jqgrid and the only issue is Edit form is not closed after editing, whereas Add form and Delete form are closed and reloaded properly. I think I am giving the options order incorrectly but I tried different permutations but no luck. Can anyone give a look at my javascript and provide any suggestions?
$("#person").jqGrid('navGrid', '#personpager', { edit: true, add: true, del: true, search: true },
{ closeAfterEdit:true, reloadAfterSubmit: true },
{ closeAfterAdd:true, reloadAfterSubmit: true },
{ reloadAfterSubmit: true },
{ closeOnEscape:true, multipleSearch: true, closeAfterSearch: true },
{});
推荐答案
我尝试了所有可能添加closeAfterEdit: true
的地方后,才解决了这个问题.我在colModel中定义了formatoptions以打开模式进行编辑;看起来formatoptions.editoptions
是我需要设置值的地方:
I just resolved this after trying every place I could possibly add closeAfter true
. I had defined formatoptions in my colModel to open modal for edit; looks like formatoptions.editoptions
was the place I needed to set the value:
colModel: [...{
name: 'Edit',
search: false,
width: 60,
sortable: false,
edittype: 'button',
formatter: 'actions',
formatoptions: {
editformbutton: true,
editOptions: {
**closeAfterEdit: true**
},
delOptions: {
...
},
onclickSubmit: function (params, postdata) {
var rowData = $(this).getRowData(postdata);
return { TagId: rowData.TagId };
}
}
},
title: false
},
这篇关于编辑表单jqGrid后closeAfterEdit无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!