Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
error in capturing server errors
11/12/2009
02:06
Avatar
yretuta
Member
Members
Forum Posts: 3
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

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!

11/12/2009
14:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

14/12/2009
02:07
Avatar
yretuta
Member
Members
Forum Posts: 3
Member Since:
11/12/2009
sp_UserOfflineSmall Offline

haven't realized that, maybe loadError is not what I need when I want to change the default display of server errors (the modal dialog) to a custom message of my preference...what do u think can get that done? Sorry if ever this was in the demo and I missed itLaugh

15/12/2009
18:47
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information