Results 1 to 4 of 4

Thread: Identify selected tab in plain tab Panel

  1. #1
    Sencha Premium Member
    Join Date
    May 2014
    Posts
    3

    Default Identify selected tab in plain tab Panel

    Hello,

    I have a plainTabPanel and 2 tabs say "Tab-1" and "Tab-2". where "Tab-1" and "Tab-2" are independent views. I want to find out which tab is currently active/selected by the user. How can I achieve it?

    Thanks,

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    I think
    Code:
    plainTabPanel.getActiveWidget()
    is what you are looking for.

  3. #3
    Sencha Premium Member
    Join Date
    May 2014
    Posts
    3

    Default

    plainTabPanel.getActiveWidget() is not working for me.

    In Tab-1 I have an object of myView Class (myView.java) and myView.java extends IsWidget class.
    In Tab-2 I have a Simple Container.

    My specific question is how to find if the getActiveWidget() is a object of myView class(Tab-1) or an instance of Simple Container(Tab-2)

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    Quote Originally Posted by jeremy_mccoy View Post
    plainTabPanel.getActiveWidget() is not working for me.

    In Tab-1 I have an object of myView Class (myView.java) and myView.java extends IsWidget class.
    In Tab-2 I have a Simple Container.

    My specific question is how to find if the getActiveWidget() is a object of myView class(Tab-1) or an instance of Simple Container(Tab-2)
    There you go.
    I had a similar issue. Solved it by setting id on my widgets.
    Code:
    someWidget.getElement().setId(itemId);
    Then you can ask activeWidget for its id:
    Code:
    tabPanel.getActiveWidget().getElement().getId();

Similar Threads

  1. how to uniquely identify text fields in a Panel
    By nish1013 in forum Sencha Touch 1.x: Q&A
    Replies: 3
    Last Post: 8 Mar 2012, 9:45 AM
  2. How to identify tab switch in a tab panel
    By Eugene Krivopaltsev in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 7 Dec 2010, 8:21 PM
  3. How to identify the selected menu item?
    By gvargas in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 12 Jun 2009, 7:37 AM
  4. Replies: 0
    Last Post: 7 Nov 2007, 5:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •