Results 1 to 6 of 6

Thread: How to add Tabs dynamically

  1. #1
    Ext User
    Join Date
    Mar 2009
    Posts
    40
    Vote Rating
    0
      0  

    Default How to add Tabs dynamically

    Hi,
    I have a Grid, Button and a PopUp window, On selecting any row from Grid Button will be enabled and on clicking that Button a PopUp window will get visible. In this window i want to display Tabs dynamically based on the number of records retrieved from Database. And also the name of Tab item is a value from the data retrieved from database.Kindly help me in solving this problem.

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    You can simple add this tabs to the tabpanel. The layout of the TabPanel will manage the displaying of the tabs.

  3. #3
    Ext User
    Join Date
    Mar 2009
    Posts
    40
    Vote Rating
    0
      0  

    Default

    I want to know how to add this tabs to TabPanel because i doesn't know how many tabs to create as the data is coming from database.

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    Code:
    tabpanel.add(tabItem)

  5. #5
    Ext User
    Join Date
    Mar 2009
    Posts
    40
    Vote Rating
    0
      0  

    Default

    Number of tabItems depends on the number of records fetched from database.From database if i get 1 record i have to add 1 tabItem, if 2 records then 2 tabItems and so on.........

  6. #6
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    Code:
    for(int i=0;i<recordcount;i++){
      TabItem item = new TabItem();
      tabpanel.add(tabItem);
    }

Posting Permissions

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