EasyUI Forum
May 03, 2024, 04:59:58 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Grid OnLoadError  (Read 13948 times)
mapner
Jr. Member
**
Posts: 63


View Profile
« on: September 17, 2012, 06:40:56 AM »

Hello:

in Grid - OnLoadError how to make for receive an error message from the server?

thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 18, 2012, 02:47:43 AM »

What error messages do you want to receive? This event is triggered if the ajax request fails.
Logged
mapner
Jr. Member
**
Posts: 63


View Profile
« Reply #2 on: September 18, 2012, 05:11:07 AM »

Ok, when I try to load a Datagrid and a database error happen in PHP, how to send and receive the database error message for show it in UI?

Logged
mzeddd
Full Member
***
Posts: 223



View Profile
« Reply #3 on: September 18, 2012, 06:09:25 AM »

Do you mean you want to get some text like "We are sorry, but .... Sad" sent by PHP script to your DataGrid?

Or would you like to have static message like "Failed to load data" from DataGrid and do not know how to trigger it by PHP?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: September 18, 2012, 06:12:36 AM »

In fact, this is not ajax errors. The 'onLoadError' event is no suitable to do this. Try adding addtionable message in your success returning data.
{"total":0,"rows":[...],"err":"..."}

The data above will be sent to browser, you can use 'onLoadSuccess' event or 'loadFilter' function to get this data and retrieve the error message.
Logged
mapner
Jr. Member
**
Posts: 63


View Profile
« Reply #5 on: September 18, 2012, 10:18:07 AM »

Ok Stworthy,  thanks! 
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!