EasyUI Forum

General Category => General Discussion => Topic started by: Shanthi on August 02, 2016, 08:40:39 AM



Title: OnLoad of tab should call external xajax call
Post by: Shanthi on August 02, 2016, 08:40:39 AM
I am using Easy UI Nested tab concept in our php web application.

When I click on the parent tab, the first tab gets loaded by default. During the on load of this tab I need to call a JS function which in-turn will call a Xajax method.

Below is the code:

Mark-up:
<div id="tt" class="easyui-tabs" data-options="tabWidth:275" style="width:1600px;height:850px;">
     <div title="Neo Lab" style="padding:20px;display:none;">
             <div id="neoLab" class="easyui-tabs" data-options="fit:true,plain:true">
                  <div id="getStrtd" title="Getting Started" data-options="tabWidth:200" style="padding:10px;"></div>
             </div>
    </div>
</div>

JS:

var q = $('#neoLab').tabs().tabs('tabs')[0];
var qb = q.panel('options').tab.find('a.tabs-inner');

qb.linkbutton().bind('click', function(){
            alert('getting started');
            wrapperjs('loadGettingFocused','FEDENavBar');
         });

If I use this, in the click of the tab, the panel gets loaded. I need to use the functionality for the onload of the tab.
I tried bind('load'). that didn't work too.

Please advise.


Title: Re: OnLoad of tab should call external xajax call
Post by: stworthy on August 02, 2016, 06:59:32 PM
Please set the 'onLoad' event for the tab panel. When load data from an external page successfully, the 'onLoad' event fires.
Code:
<div id="getStrtd" title="Getting Started" data-options="tabWidth:200,onLoad:function(){}" style="padding:10px;"></div>


Title: Re: OnLoad of tab should call external xajax call
Post by: Shanthi on August 03, 2016, 03:18:38 AM
Thanks for the quick reply... I tried the below code.

<div id="getStrtd" title="Getting Started" data-options="tabWidth:200, onLoad:function()
                                                                        {
                                                                           alert('getting stt');
                                                                           wrapperjs('loadGettingFocused','FEDENavBar');
                                                                        }" style="padding:10px;"></div>

I am not getting the alert, nor the page loads. i.e When I clear the browsing history, the panel gets loaded the first time.
If I do a refresh of the page, the panel is not loading. In both cases, I am not getting the alert.

My question is the alert in the onload fn is not coming up. does that mean the onLoad is not getting called?


Title: Re: OnLoad of tab should call external xajax call
Post by: stworthy on August 03, 2016, 08:51:01 AM
The 'onLoad' fires when remote is loaded successfully. To trigger this event, you must set the 'href' property or call 'refresh' method to load remote data.