Results 1 to 6 of 6

Thread: Tab Panel refresh content of a tab

  1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    27
    Answers
    1
    Vote Rating
    0
      0  

    Default Tab Panel refresh content of a tab

    Hello,

    I have a tabpanel, and when I click on a menu I hava some tabs which appears.

    I need to change the content (the item in fact) of a tab switch a variable session ($_SESSION['VARIABLE']). But, even if my variable change, the tabPanel always contain the same item.
    Here is the definition of my tab :

    Code:
    tabPanel.add({
                                        id : 'tabObsNov',
                                        frame:false,
                                        border:false,
                                        autoShow:true,
                                        closable: true,
                                        closeAction:'destroy',
                                        title: 'myTab',
                                        items:[
                                            {
                                                border:false,
                                                html: Ext.get('tabObsNovTxt').dom.innerHTML
                                            },
                                            {
                                                border:false,
                                                width:'55%',
                                                margin:'10 0 0 200',
                                                items:[<?Php 
                                                        if($_SESSION['VARIABLE']=="on"){
                                                            echo "ObsNovForm" ;
                                                        }
                                                        else{
                                                            echo "ObsAdvForm";
                                                        }?>
                                                ]
                                            }
                                        ]
                                }).show();
    I tried to destroy the current tab with tab.destroy() and call a new one but always the same tab is opened and I don't understand why

    Any Idea ?

    Sylvia From Bordeaux (France)
    Last edited by syl_via38; 26 Jan 2012 at 2:08 AM. Reason: Answered

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    86
      0  

    Default

    My only guess is that the code that you're generating is static to the page instance that you've loaded. <shrugs>

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    27
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Well, Thanks for your answer. But I don't understand.

    Do you have an idea to solve my problem ? I thought that if I destroy my tab and create a new one it can works but not ...

  4. #4
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
      0  

    Default

    You must use tabPanel.remove(someComponent) to remove a 'tab' from the tabpanel.

  5. #5
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    86
      0  

    Default

    Quote Originally Posted by syl_via38 View Post
    Well, Thanks for your answer. But I don't understand.

    Do you have an idea to solve my problem ? I thought that if I destroy my tab and create a new one it can works but not ...
    Chances are the JavaScript that is automatically generated by the PHP code is static.

    It's hard to really understand what your problem is. Language barriers are not cool!

  6. #6
    Sencha User
    Join Date
    Feb 2010
    Posts
    27
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Well, I use your solution : tabPanel.remove() and it seems to work. Thanks a lot !

    @jay : yes, sorry for my poor english, it's not very easy to explain technical issues with foreign language !

Posting Permissions

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