jqgrid reload is not updating the data
Hi all,
I'm very new to Jquery. I have one jqgrid which contains one hidden id . When i try to add a new row i observed that id is populating like jqq1. Once i do refresh the page then the id is populating properly . I need to refresh the grid with updated data . I'm struggling with this issue from past 1 week , tried a lot of options but none of them solve my issue .
Here is my code : mygrid.jqGrid('navButtonAdd','#pager', {
caption: "",
buttonicon: "ui-icon-plus",
onClickButton: function createRow() {
mygrid.jqGrid('editGridRow', 'new', {
recreateForm: true,
reloadAfterSubmit:false,
viewPagerButtons: false,
closeAfterAdd: true,
width: "500",
url: '${h2ng:encodeJs(updateData)}',
editData: {'id':-1,'listId': $('#listId').val()},
beforeSubmit:function(postdata, formid) {
if ((postdata["data1"] == null || postdata["data1"].length < 1)
&& (postdata["data2"] == null || postdata["data2"].length < 1)
&& (postdata["data3"] == null || postdata["data3"].length < 1)
&& (postdata["data4"] == null || postdata["data4"].length < 1)) {
return [false,"error message"];
}
else
return [true];
},
afterComplete:function() {
$("#mygrid").trigger("reloadGrid");
return true;
},
afterSubmit:function(response, postdata, formid) {
if (response.responseText != "") {
var responseText = response.responseText.evalJSON();
if (responseText.error != null) {
return [false,responseText.error];
} else {
return [true];
}
} else {
return [true];
}
}
});
}
});
load once is true and data type is : local
any help would be highly appreciated ...