ctp
20 Oct 2010, 9:12 AM
Howdy,
I use this simple function for my change listener:
listeners: {
change: function(obj) {
tmpProp[obj.id] = this.getValue();
for (var record in tmpProp) {
console.log(record + ': ' + tmpProp[record]);
}
}
}tmpProp is a global Object() instance. I need this code dozens of times so I try to get the code out of my listener: {change: {}} block to reuse it everywhere I need it. I'm using an application class like described in http://www.sencha.com/learn/Tutorial:Application_Layout_for_Beginners but don't get the code running. Anyone has a hint how to define an external function for this listener?
I use this simple function for my change listener:
listeners: {
change: function(obj) {
tmpProp[obj.id] = this.getValue();
for (var record in tmpProp) {
console.log(record + ': ' + tmpProp[record]);
}
}
}tmpProp is a global Object() instance. I need this code dozens of times so I try to get the code out of my listener: {change: {}} block to reuse it everywhere I need it. I'm using an application class like described in http://www.sencha.com/learn/Tutorial:Application_Layout_for_Beginners but don't get the code running. Anyone has a hint how to define an external function for this listener?