Forum


02:06

11/12/2009

I've read the documentation and wrote what was supposed to catch the server error yet the the loadError event is not triggered. Here's some code for clarification:
$('#hotels').jqGrid({
url : base_url + 'administrator/ajaxhotel',
datatype : 'json',
mtype : 'GET',
colNames : ['Hotel ID' , 'Hotel Name', 'Hotel Location','Type', 'Status', 'Active', 'Date Added'],
colModel : [
{name: 'id', index: 'id'},
{name: 'name', index : 'name', editable: true, editrules:{required:true, custom:true, custom_func: check_hotel_exists}, formatter: hotel_link_formatter, unformat:hotel_link_unformatter},
{name: 'location', index:'location'},
{name:'type', index:'type'},
{name: 'status', index: 'status', editable:true, edittype:'select', editoptions: {value: 'normal:Normal;sold:Sold'}},
{name: 'active', index: 'is_active', width: 100, resizable: false, editable:true, edittype:'select', editoptions:{value: '1:Active; 0:Not Active'}},
{name: 'date_added', index: 'date_added'},
],
cellEdit : true,
cellurl : base_url + 'administrator/ajaxhoteledit',
editurl : base_url + 'administrator/ajaxhoteledit',
afterSaveCell : showmessagecallback,
pager : '#pager',
emptyrecords: 'Nothing to display',
rowNum : 3,
rowList : [3, 5, 7],
sortname : 'name',
viewrecords : true,
caption : 'Hotel Listings',
autowidth: true,
multiselect : true,
errorCell : function(){
alert(triggered)
$('#message').text('An error has occurred while processing your request. Please check the manual for more information');
},
loadError : function(xhr, st, str){alert('loadError triggered');}
}).navGrid('#pager', {edit:false, add:false});
$('#hotels').jqGrid('hideCol', 'id');
Please help!
14:36

Moderators
30/10/2007

Hello,
I'm not sure what you expect to be a error in this case.
loadError is just replacement for jQuery ajax error.
Also if you run pure ajax with
$.ajax({
....
error : function(...) {
...
}.
...
});
it is the same as
...jqGrid({
...
loadError : function() {
...
},
...
});
Run the first code and see if the error occur.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
18:47

Moderators
30/10/2007

Hello,
Not sure that this will meet you requierments, but you can
1. use loadComplete for this purpose
2. You can define custon tag in userData array and depending from the server response to notify the user for something
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
56 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66