I found many response about my question and do that correctly, but as somebodies have such problem, my problem does not solved. i.e. my form does not disappear after click on submit button. I use this code: (I guess my problem is tiny but i can not solve it, Please help me)
$(function(){
$("#grid").jqGrid({
url:'example.php',
datatype: 'xml',
mtype: 'POST',
colNames:['Inv No','Date', 'Amount','Tax','Total','Notes'],
colModel :[
{name:'invid', index:'invid', width:55, align: 'center'},
{name:'invdate', index:'invdate', width:90, align: 'center'},
{name:'amount', index:'amount', width:80, align:'center',editable: true},
{name:'tax', index:'tax', width:80, align:'center',editable: true},
{name:'total', index:'total', width:80, align:'center'},
{name:'note', index:'note', width:150, sortable:false}
],
height: 'auto',
width: 'auto',
editurl: "edit.php",
pager: '#pager',
rowNum:10,
cellEdit: true,
cellsubmit: 'remote',
cellurl: 'edit.php',
ondblClickRow: function(id, status) {
//var pageNumber = jQuery("#grid").getGridParam('rowNum');
//jQuery("#grid").editGridRow(id);
alert(id);
},
afterSubmitCell: function(response) {
if(response.responseText == "ERROR")
alert('Zekki');
},
beforeSubmitCell: function() {
alert('before');
},
rowList:[10,20,30],
sortname: 'invid',
sortorder: 'asc',
viewrecords: true,
gridview: true,
caption: 'My first grid',
multiselect: true,
multikey: 'ctrlKey',
toolbar: [true,'bottom'],
loadComplete: function () {
//alert("OK");
},
loadError: function (jqXHR, textStatus, errorThrown) {
alert('HTTP status code: ' + jqXHR.status + '\n' +
'textStatus: ' + textStatus + '\n' +
'errorThrown: ' + errorThrown);
alert('HTTP message body (jqXHR.responseText): ' + '\n' + jqXHR.responseText);
}
}).navGrid('#pager',{edit:true,add:true,del:true},
{
afterSubmit:processAddEdit,
closeAfterAdd: true,
closeAfterEdit: true,
reloadAfterSubmit:true,
},
{
afterSubmit:processAddEdit,
closeAfterAdd: true,
closeAfterEdit: true,
reloadAfterSubmit:true,
},
{
afterSubmit:processAddEdit,
closeAfterAdd: true,
closeAfterEdit: true,
reloadAfterSubmit:true
}).filterToolbar();
function processAddEdit(response, postdata) {
alert("* "+response.responseText+" *");
}
/*var pageNumber = jQuery("#grid").getGridParam('page');
var rowNumber = jQuery("#grid").getGridParam('rowNum');
*/
});
Thanks Best Regards