1
我正尝试使用事件代理向商店添加我在Sencha中检查的复选框的标签。Sencha/ExtJS中的事件代表问题
我怎样才能通过复选框的标签作为参数?我代表团做得好吗?我有一个错误,如'意外的令牌'。
我真的不得不把功能分开,因为我想写30个复选框,并且每个人都有相同的监听器时被选中。
非常感谢你提前。
{
xtype: 'checkboxfield',
label: 'Noir',
listeners: {
check: anadir(label)
}
}
]
}
]
},
anadir: function(label){
console.log("Añadiendo...");
var index = storemisOpciones.getCount() - 1;
console.log("Indice: " + index);
storemisOpciones.add({option: label});
console.log(label + " se ha marcado");
index = storemisOpciones.getCount() - 1;
console.log("Indice: " + index);
console.log(storemisOpciones.getAt(index));
storemisOpciones.sync();
},