EasyUI Forum
November 01, 2025, 12:39:49 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: OnLoad of tab should call external xajax call  (Read 11296 times)
Shanthi
Newbie
*
Posts: 3


View Profile
« 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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>
Logged
Shanthi
Newbie
*
Posts: 3


View Profile
« Reply #2 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?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 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.
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!