1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    38
    Vote Rating
    0
    Angilo is on a distinguished road

      0  

    Arrow Properties assigning grid to tabpanel

    Properties assigning grid to tabpanel


    Hi all,

    I'm constructing a dynamic tabpanel.
    1 Tab contains a grid, which is a main grid (it contains all shipping tables, but the m shipping tables themself contain n rows. So, when you click a shipping table, a new tab opens which contains the grid with the n rows that belongs to shipping table i.

    In code:

    Code:
    var tabs = new Ext.TabPanel({
            renderTo:'tabs',
            resizeTabs:true,
            minTabWidth: 115,
            tabWidth:135,
            enableTabScroll:true,
            activeTab: 0,
            width:940,
            height:765,
            defaults: {autoScroll:true, closable: true},
            items: [ShippingTablesListingEditorGrid],
            plugins: new Ext.ux.TabCloseMenu()
        });
    AddTab function:
    Code:
    function addTab(tabTitle, addObject){
    		tabs.add(addObject).show();
        }
    The problem is the first tab (grid which contains all m shipping tables) should NOT be able to be closed. But all other tabs (grids which contain n rows that belongs to shipping table i) SHOULD be able to be closed.

    How can I manage that? Thanks in advance guys!

    ExtJS rocks by the way...

  2. #2
    Ext JS Premium Member
    Join Date
    Jan 2010
    Location
    Austria
    Posts
    87
    Vote Rating
    0
    Nesta is on a distinguished road

      0  

    Default


    http://www.extjs.com/deploy/dev/docs/?class=Ext.Panel
    [Quote]
    closable : BooleanPanels themselves do not directly support being closed, but some Panel subclasses do (like Ext.Window) or a Panel Class within an Ext.TabPanel. Specify true to enable closing in such situations. Defaults to false.


    [Quote]

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    38
    Vote Rating
    0
    Angilo is on a distinguished road

      0  

    Default


    Quote Originally Posted by Nesta View Post
    http://www.extjs.com/deploy/dev/docs/?class=Ext.Panel
    closable : BooleanPanels themselves do not directly support being closed, but some Panel subclasses do (like Ext.Window) or a Panel Class within an Ext.TabPanel. Specify true to enable closing in such situations. Defaults to false.
    And how should that help me with my code?

  4. #4
    Ext JS Premium Member
    Join Date
    Jan 2010
    Location
    Austria
    Posts
    87
    Vote Rating
    0
    Nesta is on a distinguished road

      0  

    Default


    ShippingTablesListingEditorGrid: set closable to false
    all other panel should be closable because you define your TabPanel with defaults{closable:true}

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    38
    Vote Rating
    0
    Angilo is on a distinguished road

      0  

    Default


    Quote Originally Posted by Nesta View Post
    ShippingTablesListingEditorGrid: set closable to false
    all other panel should be closable because you define your TabPanel with defaults{closable:true}
    Thank you for your help. I already tried it, but it doesn't work.
    ShippingTablesListingEditorGrid remains closable.

  6. #6
    Ext JS Premium Member
    Join Date
    Jan 2010
    Location
    Austria
    Posts
    87
    Vote Rating
    0
    Nesta is on a distinguished road

      0  

    Default


    have you tried to remove the defaults{closable:true} and set closable on the newly created components?


    btw:
    Code:
    tabs.add(addObject).show();
    split thie in
    Code:
    tabs.add(addObject);
    addObject.show();
    i had problems with the one-liner when adding more complex components

  7. #7
    Sencha User
    Join Date
    Mar 2010
    Posts
    38
    Vote Rating
    0
    Angilo is on a distinguished road

      0  

    Default


    Thanks for your help Nesta.

    Quote Originally Posted by Nesta View Post
    have you tried to remove the defaults{closable:true} and set closable on the newly created components?
    No, how can I set closable on the newly created components? Can I add parameters?

    btw:
    Code:
    tabs.add(addObject).show();
    split thie in
    Code:
    tabs.add(addObject);
    addObject.show();
    i had problems with the one-liner when adding more complex components
    Okay thanks for the tip.

  8. #8
    Ext JS Premium Member
    Join Date
    Jan 2010
    Location
    Austria
    Posts
    87
    Vote Rating
    0
    Nesta is on a distinguished road

      0  

    Default


    When a component is created, the closable config is read and the "x-button" is added. There is no way
    to add this button later (only with an extension).

    i guess, you have a dblclick listeners on the grid in your maintab which creates a grid and adds it as a new Tab.
    speficing "closable: false" during creation of this new element should work.

    Code:
    var addObject = new Ext.*.*({ // Any ext Component extending Panel
         ...., //your config
        closable: false
    })

Thread Participants: 1