EasyUI Forum
April 18, 2024, 01:13:22 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: Receive load or failure events from ajax tab content  (Read 6555 times)
linuskamb
Newbie
*
Posts: 5


View Profile Email
« on: March 28, 2017, 04:04:16 PM »

Hi all,

Is it possible to receive any feedback when a tab is created with an href specifying content location, such as content loaded or error response or timeout or ?

Thanks,
Linus
Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 on: March 28, 2017, 07:40:38 PM »

Please listen to the 'onLoad' event, which fires when loading data into a tab panel successfully.
Code:
$('#tt').tabs({
onLoad: function(panel){
//...
}
})
Logged
linuskamb
Newbie
*
Posts: 5


View Profile Email
« Reply #2 on: March 29, 2017, 10:45:01 AM »

Hi jarry,

Thanks for your response.  I have added listeners for that event and the others. 

That is good for getting notified that the content was successfully loaded, but I more importantly would like to get notified of failures or errors on loading.

Is there a way to capture those errors?

thanks,
- Linus
Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #3 on: March 30, 2017, 06:41:08 PM »

If a panel does not load remote content successfully, the 'onLoadError' event fires. Please bind the 'onLoad' and 'onLoadError' events on your special panels.
Code:
<div class="easyui-tabs">
<div title="tab1" data-options="
onLoad: function(){
//...
},
onLoadError: function(){
//...
}
"></div>
<div title="tab2"></div>
</div>
Logged
linuskamb
Newbie
*
Posts: 5


View Profile Email
« Reply #4 on: April 04, 2017, 03:03:02 PM »

Indeed.  Thank you.   That event wasn't listed under the tabs events, but I see it is available for panels.

Still learning,
- Linus
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!