there is a togglefield in componentView's item, i want to listen the change event of togglefield control. if i do this as following:
Code:
{ xtype: 'togglefield',
listeners: {
change: function (me, thumb, value, options) {
if(value == 1) {
...
}
else {
...
}
}
}
the change event of first item in componentView can be catched when i tap the toggle of first item. but the change event of other items in componentView can't be catched. Why?
So i want to add a listener for togglefield in initialize function, how to write the addListeners code??
Code:
Ext.define('ShopSystem.view.SyohinZanListItem', {
extend: 'Ext.dataview.DataItem',
......
initialize: function(){ this.down('title').setTitle(this._syohin_name.getHtml());
var s2 = this.down('togglefield');
s2.addListener(.....) ???