PDA

View Full Version : tbar content that's not a button



djfiii
21 Apr 2008, 7:28 AM
Say I have the following:


tbar: [
{xtype: 'tbbutton', text: 'Word', handler: quickExport, format: 'word'},
{xtype: 'tbbutton', text: 'Excel', handler: quickExport, format: 'excel'}
],

I'm eventually going to make those icons instead of text, however I'm also interested in putting some plain text right before them that isn't actually a button (i.e. no mouseover effect). See the two attachements that illustrate what I mean. In this example, the [139] would be a dynamic string representing the number of rows in the panel in which the tbar lives. I'd think something like this would be fairly common - another use would be a tbar with buttons on the left, and a message on the right such as "You are logged in as Joe Blow", etc.

Any tips are appreciated!!

devnull
21 Apr 2008, 8:05 AM
For just a plain static label, you can include a string as one of the tbar items. I imagine you could make it dynamic by wrapping it in a div with an id. I believe the paginbar uses a template somehow, so you might look into that too.

djfiii
21 Apr 2008, 10:52 AM
Thanks! I tried a few different ways of doing what you describe, and it all just breaks my js. Would you mind demonstrating with the code snippet above?

catacaustic
21 Apr 2008, 2:11 PM
Look at the CSS, and create a custom class for your buttons that doesn't show the background image, that's all it takes.
.blank-button .x-btn-left, .blank-button .x-btn-right, .blank-button .x-btn-center {
background: none !important;
}

treqx
21 Apr 2008, 2:17 PM
This is what I do to get the "You are logged in as..." type of message in a toolbar:

The tbfill item makes everything that comes after right-justified.



}, {
xtype: 'tbfill'
}, {
xtype: 'tbtext',
text: 'Logged in as: ' + currentUser + '  '
}

djfiii
9 May 2008, 7:30 AM
This is what I do to get the "You are logged in as..." type of message in a toolbar:

The tbfill item makes everything that comes after right-justified.



}, {
xtype: 'tbfill'
}, {
xtype: 'tbtext',
text: 'Logged in as: ' + currentUser + '  '
}


exactly what I was looking for. thx!!

mcouillard
20 Aug 2008, 12:54 PM
Double-thanks, treqx! Just what I was looking for.