closeAfterEdit not working after editing the form jqGrid

佐手、 提交于 2020-01-07 02:16:09

问题


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

回答1:


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




回答2:


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
              },


来源:https://stackoverflow.com/questions/11750121/closeafteredit-not-working-after-editing-the-form-jqgrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!