Hey,
Started using jqWidgets and have enjoyed them so far. I’ve run into a bit of a problem catching a 403 error and handling it though. I’ve got a page with a Grid widget that uses a DataAdapter to make a call to a PHP service to get a JSON string of the data it is to display. Not an unusual arrangement and easy to implement. However, the PHP service does require that the user be logged in to use it. So, it is throwing a 403 Forbidden Error. Once again, not unusual and expected. However, what is unexpected is that the Grid hangs up with a little “Loading…” window. I’ve attempted to catch the error and handle it in the following ways…
var dataAdapter = new $.jqx.dataAdapter(source, {
downloadComplete: function (data, status, xhr)
{
alert("Download complete!");
},
loadComplete: function (data)
{
alert("Load complete!");
},
loadError: function (xhr, status, error)
{
alert("Load Error!");
}
});
None of the above events fires. I’ve also tried setting the jQuery ajaxSetup in order to handle the situation like thus..
$.ajaxSetup(
{
error: function (x, status, error) {
alert("Error!");
if (x.status == 403) {
alert("Sorry, your session has expired. Please login again to continue");
}
else {
alert("An error occurred: " + status + "nError: " + error);
}
}
});
But that doesn’t fire either.
I am obviously missing something. Is there an event that I should be using that I’m not seeing?
I’m using…
jQuery 2.0.2
jqWidgets 3.2.1
Chrome 33.0.1750.146 m
Any help would be appreciated.
Thanks,
Andrew