-
15 May 2010 4:56 AM #1
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:
AddTab function: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() });
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.Code:function addTab(tabTitle, addObject){ tabs.add(addObject).show(); }
How can I manage that? Thanks in advance guys!
ExtJS rocks by the way...
-
15 May 2010 5:39 AM #2
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]
-
15 May 2010 6:08 AM #3
-
15 May 2010 6:12 AM #4
ShippingTablesListingEditorGrid: set closable to false
all other panel should be closable because you define your TabPanel with defaults{closable:true}
-
15 May 2010 7:09 AM #5
-
15 May 2010 8:39 AM #6
have you tried to remove the defaults{closable:true} and set closable on the newly created components?
btw:
split thie inCode:tabs.add(addObject).show();
i had problems with the one-liner when adding more complex componentsCode:tabs.add(addObject); addObject.show();
-
16 May 2010 4:43 AM #7
Thanks for your help Nesta.
No, how can I set closable on the newly created components? Can I add parameters?
Okay thanks for the tip.btw:
split thie inCode:tabs.add(addObject).show();
i had problems with the one-liner when adding more complex componentsCode:tabs.add(addObject); addObject.show();
-
16 May 2010 5:32 AM #8
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 })


Reply With Quote
