下面是我的代码,我需要在提交后关闭添加/编辑对话框。在这两种情况下,它都会更新服务器并重新加载网格,但不会关闭对话框:
jQuery("#toolbar1").jqGrid({
url:'category/getcategorylist',
datatype: "xml",
colNames:["Name","Description","Id"],
colModel:[
{name:"cname",index:"cname",editable:true, width:250, align:"center",xmlmap:"categoryName"},
{name:"cdescription",index:"cdescription", editable:true,width:300, align:"center",xmlmap:"description"},
{name:"id",index:"id", editable:true,width:210, align:"center",xmlmap:"categoryId",key: true,hidden: true},
],
rowNum:100,
viewrecords: true,
toppager:true,
height:250,
width:800,
modal:true,
sortorder: "asc",
xmlReader: {
root : "CategoryList",
row: "categoryList",
repeatitems: false
},
});
$("#toolbar1").jqGrid("navGrid", "#toolbar1_toppager", {
reloadAfterSubmit:true, view: false, search:false ,addtext: 'Add',
edittext: 'Edit',
deltext: 'Delete',
refreshtext: 'Reload'
},
{url: "category/updatecategory"}, {url: "category/createcategory"}, {url:"category/deletecategory"});