-
21 Aug 2012 10:29 PM #1
Unanswered: Tab header character limit
Unanswered: Tab header character limit
Hi there,
I haven't been able to find the answer to this - hence my post
For tab titles.. after x amount of characters the title is shortend to i.e. "My lov...", is there anyway to change this?
Maybe extend the max char limit or remove it altogether?
Thanks in advance!
-
21 Aug 2012 11:02 PM #2Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
Use Ext.util.Format.ellipsis()
Use Ext.util.Format.ellipsis()
Hi Stevanicus,
If you want to truncate (....) the tab panel title, you can use Ext.util.Format.ellipsis() class. For example-
For more detail read API http://docs.sencha.com/ext-js/4-1/#!...ethod-ellipsisCode:Ext.create('Ext.tab.Panel', { width: 400, height: 400, renderTo: document.body, items: [{ title: Ext.util.Format.ellipsis('Offer item', 8) }, { title: Ext.util.Format.ellipsis('Custom Title', 6) }] });sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
21 Aug 2012 11:15 PM #3
Thanks for replying!
It truncates the title automatically... I want to extend the number that it truncates at.
With every key stroke on the "title textfield" the tab title is updated. Is there a config anywhere that I have overlooked to extend the truncation limit?
Thanks again
-
21 Aug 2012 11:43 PM #4Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
You can achieve this by set maxWidth to the tabPanel title under tabConfig.
Code:Ext.create('Ext.tab.Panel', { width: 400, height: 400, renderTo: document.body, items: [{ title: 'First tab', }, { title: 'Second tab for testing', tabConfig: { maxWidth:100 } }] });sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
22 Aug 2012 12:18 AM #5
Thanks!
However it only works for smaller values
Try setting
tabConfig: { maxWidth:500 }
Doesn't go beyond its default width
thanks again
-
22 Aug 2012 9:00 AM #6Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
I see the tab expand as I increase the value: (Ext 4.1.1)
500: stops at 6
600: stops at 8
ScottCode:Ext.create('Ext.tab.Panel', { width: 400, height: 400, renderTo: document.body, items: [{ title: 'First tab', }, { title: 'Second tab for testing asdasdad1 asdadasd2 asdadad2 asdasdad4 adasdada5 asdadad6 asdasd7 asdasdad8 asdadasd9 asdadasd0 ', tabConfig: { maxWidth:600 } }] });
-
6 Sep 2012 3:44 AM #7
Sorry about my late reply,
However, it seems to reset itself if you use the setTitle() method afterwards.
For example I have a textfield which updates the tab title.
Thanks


Reply With Quote