EasyUI Forum
May 16, 2024, 09:57:55 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: Newbie, Please Help  (Read 10168 times)
DN
Newbie
*
Posts: 6


View Profile
« on: January 14, 2014, 05:33:50 PM »

Hi,

I have created a tabs, and try to programmatically navigate to the next tab in my java script function as below, and as soon as it hits that tabs(), it gave me an error: Object [object Object] has no method 'tabs'


<div id="tabTest" class="easyui-tabs" data-options="tabWidth:150,tabHeight:80" style="height:400px">
....
</div>


function MoveToNextTab()
    {
        try
        {
            var tab  = $('#tabTest').tabs('getSelected');
            var index =   $('#tabTest').tabs('getTabIndex', tab);
            if(index < 5) index++;
            else index = 0 ;
            
            $('#tabTest').tabs('setTabIndex', tab); // Huh? How
        }
        catch(err)
        {
            txt = "There was an error on this page.\n\n";
            txt += "Error description: " + err.message + "\n\n";
            txt += "Click OK to continue.\n\n";
            alert(txt);
        }
    }

And this page has the sample of how to get the tab index.
http://www.jeasyui.com/documentation/tabs.php
« Last Edit: January 14, 2014, 05:37:45 PM by DN » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 14, 2014, 07:25:24 PM »

Please call 'select' method to navigate to another tab panel.
Code:
$('#tabTest').tabs('select', index);
Logged
DN
Newbie
*
Posts: 6


View Profile
« Reply #2 on: January 14, 2014, 10:08:11 PM »

Please call 'select' method to navigate to another tab panel.
Code:
$('#tabTest').tabs('select', index);

Thanks stworthy.  But it threw the error Object [object Object] has no method 'tabs'.  Apparently, the easyui-tabs class does not provide the tabs() function.  Or at least, that is how I interpreted the error.

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


View Profile Email
« Reply #3 on: January 15, 2014, 12:26:28 AM »

Please refer to this example http://jsfiddle.net/Vf4LG/. It works fine.
Logged
DN
Newbie
*
Posts: 6


View Profile
« Reply #4 on: January 16, 2014, 11:03:50 AM »

Please refer to this example http://jsfiddle.net/Vf4LG/. It works fine.

Thanks.  Something is not compatible when this code runs under IDE of Visual Studio 2013.  I will try to figure it out later.  And may be if I get the EASYUI demo running on my Windows 7 machine, and then I would figure it out better.

Why are all EasyUI demos that use *.json file not running on my Windows 7?  Is that because Javascript cannot open them?  Or is it because IE does not allow HTML page to read data file?

Thanks
Logged
DN
Newbie
*
Posts: 6


View Profile
« Reply #5 on: January 20, 2014, 04:36:15 PM »

Hi All,

Please help...

My application is MVC 4.5.1.  From the FireBug console, I can see that the tabs object does exist, as shown below:

>>> $('#tabWizard')
Object[div#tabWizard.easyui-tabs]

>>> $('#tabWizard')[0]
<div id="tabWizard" class="easyui-tabs tabs-container" style="height: 400px; width: auto;" data-options="tabWidth:150,tabHeight:80">

>>> $('#tabWizard').tabs('getselected')
TypeError: $(...).tabs is not a function

Note that from FireBug Net/Javascript tab, I did see the jquery.tasb.js and jquery.easyui.js are loaded.


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!