Skip to content Skip to sidebar Skip to footer

How To Avoid JQgrid Initial AJAX Request?

I am having some fun with jQgrid but now I need to achieve something that I am calling 'advanced' since I don't even know if this is a non-sense or if it can't be done but here we

Solution 1:

I think that you should use datatype: "local" instead of datatype: "json" in the grid during creating. The option datatype: "local" will prevent Ajax request and ignore url options. On the other on the select event of the Select2 element or inside of the event handler $(document).on("click", $load_form, ... you should add one more line which reset to the datatype to "json". For example the code from the old answer could be modified to

$(document).on("click", $load_form, function (ev) {
    var p = $questions_grid.jqGrid("getGridParam");
    p.datatype = "json"; // !!! the new line
    p.url = "/ajax/questions/get/" + $("#load_form").data("formid");
    $questions_grid.trigger("reloadGrid");
});

Post a Comment for "How To Avoid JQgrid Initial AJAX Request?"