Hi,
I am currently using the Infragistics JQuery Grid with server side paging. If the server throws an error when it is trying to get the appropriate page of data, then I would like to get this error message in JavaScript and do some additional processing.
In the API documentation at the link below, it says there is a "requestError" event which looks like it would be suitable for what I am trying to achieve. However, this event does not seem to fire when an error occurs.
http://help.infragistics.com/jQuery/2011.2/ui.iggrid
My code looks like this:
$('#' + gridid).igGrid({ requestError: function(evt, ui) { alert("Hello"); } });
The selector is definitely correct as I have successfully had other events grid events firing with this selector. I can also confirm that the ajax request the Grid is making to get the appropriate page, is responding with a HTTP Status code "500" for Internal Server Error.
Is there any additional steps I need to perform to achieve what I am looking for?
hi,
internally the grid uses jQuery's ajax API in order to invoke remote requests for data:
http://api.jquery.com/jQuery.ajax/
It handles the error callback, and if it is invoked, it sets the argument to false.
i suggest handling the error callback manually by calling $.ajax on the respective URL and check if it gets called. if it doesn't , it's probably not related to the grid or the data source, but more to jQuery - there could be differences or issues depending on the jquery version- , or to the server-side logic.
Thanks,
Angel
I have done as suggested and called the $.ajax method with the exact same url the grid is using as below:
$.ajax({ url: 'MyUrl', success: function(data) { alert('Success'); }, error: function(data) { alert('Fail'); }
});
This is invoking the error callback function and the "Fail" alert is getting displayed. However, when I use the "requestError" event on the grid, the "requestError" callback function is not getting invoked.
I am using jquery 1.7 and jquery ui 1.8.16 with Infragistics JQuery NetAdvantage 2011 vol 2.
This may or may not be relevant, but I cannot find any references to "requestError" in the Infragistics jquery scripts, but I can find references to all other events like "databinding" etc.
Please can you advise?
ok i see. probably the thing is that this was added in a recent service release, so if you are using an earlier 11.2 build it may not be available. i suggest to use the latest SR available for download on the website.
hope it helps. Thanks,