PDA

View Full Version : MultiSelect event in controller not trigger



dinl
1 Jul 2014, 1:05 PM
Hi, I'm trying to trigger the event change in my MultiSelect, I use:

the controller is:


Ext.define('tierras.controller.ControlDibujar', {
extend: 'Ext.app.Controller',
views : ['ViewDibujar'],
init: function(){
this.control({
'viewDibujar multiselect(action=seleccionCapa)': {
change: this.seleccionCapa
},
});
},
seleccionCapa: function(element, newValue, oldValue, eOpts ){
console.log("Hello world!");
}
});



and the view is:


Ext.define('tierras.view.ViewDibujar', {
extend: 'Ext.window.Window',
alias: 'widget.viewDibujar',
id: 'viewDibujar',
initComponent: function(){
var capasSeleccionadas = Ext.create('Ext.ux.form.MultiSelect',{
queryMode:'local',
id:'Dibujar_capasSeleccionadas',
store: Ext.create('Ext.data.Store', {
fields: ['valor', 'presentacion'],
data : [],
autoLoad: true
}),
displayField: 'presentacion',
valueField:'valor',
action: 'seleccionCapa',
});
Ext.apply(this, {
xtype: 'form',
items:[capasSeleccionadas],
});
this.callParent(arguments);
}
});



The idea is when the user select a value and the control calls the function: "seleccionCapa", but the event never trigger, żis there another event to do this?. a second question, I've read the documentation of Ext4.1 for multiselect, but I can't find a configuration property to force the component to keep always 1 item selected, is it posible?

mitchellsimoens
16 Jul 2014, 9:51 AM
It's working for me:

7oh