closeAfterEdit not working after editing the form

2019-09-16 15:57发布

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 },
           {});

2条回答
手持菜刀,她持情操
2楼-- · 2019-09-16 16:48

I just resolved this after trying every place I could possibly add closeAfterEdit: 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
              },
查看更多
Viruses.
3楼-- · 2019-09-16 17:02

this could be a bug in jqGrid version you are using, BTW what is the version you are using...anyways

look at this solution i think this is exactly what you need

jqgrid - close form dialog

查看更多
登录 后发表回答