I am using jqGrid and I want to check for keyCode to block users' request. Like, when they pressed enter key, I do this aside from before request.
I have this code:
$('#grid').jqGrid({
...,
...,
beforeRequest:function() {/* some code that returns either true or false*/}
})
In the documentation, It says, If the datatype of the beforeRequest
is a function it will not fire.
I'm not sure how to implement the before Request that is not a datatype of 'Function'
The Guriddo jqGrid documentation say: "This event fire before requesting any data. Also does not fire if datatype is function. If the event return false the request is not made to the server."
This mean that the event is not called if your datatype is function. With simple words if your datatype is not function you can use the event in the grid option. By example like this:
$("#grid").jqGrid({
...
datatype : "json", // or xml or local
url: "someurl",
beforeRequest : function() {
if(condition_not_to_request) {
return false;
}
return true;
},
...,
});
Hope this helps