i know this sounds simple for some people out there. i also tried this one. but for some reason, i really can't refresh and view my newly added, edited and deleted in jqgrid.
i am making a button in my program that would add, edit and delete and after that, it will refresh my jqgrid and display what ever change i've made in their. for example, i added new data,. in first attempt, it will display the newly added data but in the second time around, it wont show anymore. my edit and delete data won't refresh also. here's the code:
function Edit(){
var selected = $("#list1").jqGrid('getGridParam', 'selrow');
var dat = {
"ID": 'xyz',
...
"keyFields": [{"..."}]
};
update(dat);
$('#list1').trigger('reloadGrid');
}
function update(dat){
$.ajax({
type: 'GET',
url: 'mydata.php?' + $.param({path:'this/update',json:JSON.stringify(dat)}),
dataType: Settings.ajaxDataType,
success: function(data) {
if ('error' in data)
{
alert('ERROR']);
}
}
});
}
the server side is ok and updated whatever i do in the screen. when i first do this with add button only, there's no problem at all. problem came up only after my edit and delete button. hope someone can help me understand this.