PDA

View Full Version : tbtext - changing and styling



dswanson
10 Sep 2008, 6:25 AM
Hi-
I have a text item in my toolbar

{xtype:'tbtext',
id:'vcr-pos',
style:'background-color:white; border:black solid 1px;',
cls:'vcr-pos',
text:'0/0'
}
Which renders fine but my styling doesn't work either directly or via the class. Also the id is still generated.

This is the generated html for it:

<span class="ytb-text" id="ext-gen481">0/0</span>

I want to be able to alter the text at runtime and style the text as well. What's the right way to do this?

Thanks
-Doug

10 Sep 2008, 8:00 AM
i believe you can look at the toolbar.items.items[someNumber].el

dswanson
10 Sep 2008, 11:37 AM
Rockin' ... worked like a charm. Changed the text this way:

Ext.getCmp('report-detail-form').getTopToolbar().items.items[9].el.innerHTML=newText;

and this to apply the style when the panel loads:

Ext.getCmp('report-detail-form').getTopToolbar().items.items[9].el.className += ' pos-box';


Thanks!