Results 1 to 8 of 8

Thread: Need to load view(onclicking a button) inside a tab of tabpanel -Sencha 2 mvc

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    India
    Posts
    49
    Vote Rating
    0
      0  

    Default Answered: Need to load view(onclicking a button) inside a tab of tabpanel -Sencha 2 mvc

    How can we switch/load views with in a Tab inside a tabpanel..
    I have a Tabpanel and in the first Tab, I have a list, which contains a button/itemdisclosure button.
    If I click this button,I want to load a view with its details..

    What shall I do? Iam using sencha 2 mvc. Pleas someone help me..Please...

  2. this.up('container') may work.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    The tab should use card layout. The first item is the list, the second be the detail view. Then you can use setActiveItem on the tap to switch from the list to the detail.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Location
    India
    Posts
    49
    Vote Rating
    0
      0  

    Default

    CAn you please tell me how to use setaciveitem? when i use, Ext.Viewport.setActiveItem(1); Iam loading an entirely new view?not inside the tab view....

  5. #4
    Sencha User
    Join Date
    Feb 2012
    Location
    India
    Posts
    49
    Vote Rating
    0
      0  

    Default

    Iam using code like this

    xtype: 'tabpanel',
    baseCls:'tabheader',
    cls:'tab_container',
    scrollable:true,
    tabBarPosition: 'top',
    flex:1,
    items: [
    {
    xtype:'container',
    title:'Sample',
    id:'Sample',
    layout:'card',
    cardSwitchAnimation: 'slide',
    tabBarPosition: 'top',
    items:[
    {
    title: 'Sample',
    xtype: 'list',
    flex:1,
    store: 'SampleWithoutAgentOffers',
    itemTpl: '{name}' ,
    onItemDisclosure: function(record, btn, index) {
    Ext.Viewport.setActiveItem(1);
    },
    {
    xtype:'panel',
    html:'hiiii'
    }
    ]
    }}

    Please help to solve this ...

  6. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You need to get the container not use the Ext.Viewport.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  7. #6
    Sencha User
    Join Date
    Feb 2012
    Location
    India
    Posts
    49
    Vote Rating
    0
      0  

    Default

    Please please provide me the code, as Iam new, I will be stuck again, Please help me sort this out

  8. #7
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    this.up('container') may work.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  9. #8
    Sencha User
    Join Date
    Feb 2012
    Location
    India
    Posts
    49
    Vote Rating
    0
      0  

    Default

    I used this.up('#idofcontainer').setActiveItem(1); This worked..Thanks Mitchell ...

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
  •