Thursday, 20 March 2014

jqGrid "reloadGrid" using Local Data (JSON Object) 0

In jqGrid they are using .trigger('reloadGrid'); to reload the grid like below,

$('#gridID').trigger('reloadGrid');

If you are using Local data, you should mention your Local Json Data in jqGrid's
setGridParam property and you can use jqGrid's loadComplete event handler to do this like below,

loadComplete: function () {
    jQuery("#grid1")
        .jqGrid('setGridParam', {
        datatype: 'local',
        data: dynaData2 //json object
    })
        .trigger("reloadGrid");
}

See this Stackoverflow answer post.

And also read this jqGrid Documentation

0 comments:

Post a Comment