EasyUI Forum

General Category => General Discussion => Topic started by: linuskamb on March 28, 2017, 04:04:16 PM



Title: Receive load or failure events from ajax tab content
Post by: linuskamb 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


Title: Re: Receive load or failure events from ajax tab content
Post by: jarry 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){
//...
}
})


Title: Re: Receive load or failure events from ajax tab content
Post by: linuskamb 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


Title: Re: Receive load or failure events from ajax tab content
Post by: jarry 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>


Title: Re: Receive load or failure events from ajax tab content
Post by: linuskamb 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