PDA

View Full Version : Update Button Text on docked item



whodat
30 Jun 2014, 4:40 PM
Hi I have window with a form panel in it. The form panel contains an array of buttons 'create' and 'reset'.

I'd like to change the text on one of the buttons.

I'm able to get the toolbar that contains the items but not exactly sure what how to change the text of the create button.



var bbar = editCompanyWindow.down('form').getDockedItems('toolbar[dock="bottom"]');


Any help would be greatly appreciated.

Zinnia
30 Jun 2014, 10:13 PM
You can try like
vat butn = bbar.items.items[0];
butn.setText("Name");

Farish
30 Jun 2014, 11:12 PM
you can access it by index as shown above or you can assign an itemId to your button and use .down('#buttonID'). this way, its independent of the index (in case you add or remove buttons later). itemId doesnt have to be unique application wide and is better to use (compared to id).