PDA

View Full Version : How to change a boxLabel afterwards



squalo
14 Mar 2011, 12:35 AM
I try to change the labels of a group of checkboxes within store-load-event, with no success.

Any hints what I'm doing wrong?
Thx.



storeBits.on('load', function (myStore, records, options) {
var iCfg=options.add;
var BitCfgCheckboxGrp = Ext.getCmp('BitCfgCheckboxGroup_' + iCfg);
myStore.each(function (record,iBit) {
var BitId= 'Bit' + iCfg + '_' + ((myStore.getCount() - 1) - iBit);
if(BitCfgCheckboxGrp) {
var BitCheckbox = Ext.getCmp(BitId);
if(BitCheckbox) {
BitCheckbox.boxLabel = (record.data.INDICATOR?record.data.INDICATOR:'Bit#'+ record.data.Bit);
BitCheckbox.qtip = 'Bit#'+ record.data.Bit + ': ' + record.data.LEGEND;
BitCheckbox.name = record.data.CName;
BitCheckbox.disabled = (record.data.CName?false:true);

} else {
BitCfgCheckboxGrp.items[iBit] = new Ext.form.Checkbox({
boxLabel: (record.data.INDICATOR?record.data.INDICATOR:'Bit#'+ record.data.Bit),
qtip: 'Bit#'+ record.data.Bit + ': ' + record.data.LEGEND,
xtype: 'checkbox',
.....

walldorff
14 Mar 2011, 9:45 AM
maybe a doLayout() in the parent container (FormPanel, TabPanel)?