-
7 Aug 2012 1:49 PM #1
Unanswered: Assign a class to a specific Tab Panel's Tab
Unanswered: Assign a class to a specific Tab Panel's Tab
I have a Tab Panel with 5 tabs. For this panel I have a custom css style on the middle tab making it look different from the other 4 tabs (a common practice in iOS design). This has all worked well but recently I've realized if I destroy that panel and recreate it my current css targeting is not specific enough.
So my goal is to give that specific tab a css class or ID so I better target it ensuring that the style is applied each time regardless of how the tabpanel is instantiated or how many tabs it has.
Anyone know how to do this? Currently I have this
Code:Ext.define("STMobile.view.Home", { extend: 'Ext.tab.Panel', xtype: 'home', requires: [ 'Ext.TitleBar', 'Ext.TabBar', 'STMobile.view.Cases.Index', 'STMobile.view.Requests.Index', 'STMobile.view.Add.Index', 'STMobile.view.Toolsets.Index', 'STMobile.view.More.Index', 'Ext.Img' ], config: { id: 'Home', tabBarPosition: 'bottom', layout: { animation: null }, activeItem: 0, items: [ { xtype: 'casesindex' }, { xtype: 'requestsindex' }, { xtype: 'addindex', cls: 'specialTab', }, { xtype: 'toolsetsindex' }, { xtype : 'moreindex' } ] } });
However this just adds the class of "specialTab" to the actual panel that this tab activates. Not the tab itself.
-
7 Aug 2012 2:58 PM #2
Code:{ xtype: 'casesindex', iconCls:'your_class_name' }
-
7 Aug 2012 7:05 PM #3
This does not achieve my goal. This simply sets the value for the icon that will display. I am looking to add a unique selector to the tab itself.
-
8 Aug 2012 8:07 AM #4
This has to be possible. Sencha is creating the tab. There has got to be a way to give it a class or specific id. Anyone?
-
8 Aug 2012 11:28 AM #5Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
Each item should be able to accept a tab config...
Code:new Ext.tab.Panel({ items : [ { title : 'foo', tab : { cls : 'blam' } } ] });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote