this.prefixMonday[0] exists at the current scope
this.prefixMonday is an array of three checkboxes
this is within the initComponent method of an extend of a panel
this.weekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
for(var i = 0; i<7; i++){
this['prefix' +this.weekdays[i] +'[0]'].on('check',this.someFunction, this);
}
Firebug says it can’t find: this[‘prefix’ +this.weekdays[i] +'[0]’]
I’m pretty sure you have to acces
Otherwise JavaScript will search for a key with exactly the string ‘prefixMonday[0]’ and
I don’t think this is what you want. To make this more readable you might want to use a helper variable to store the name: