PDA

View Full Version : Is possible for Multiselect set prefix for each value?



mmuruev
10 Oct 2012, 2:12 AM
Subject. I want add prefix for final value if selected by another check/radio I have tried

xtype:'multiselect', listeners:{
change:function (element, newValue, oldValue) {
if (Ext.getCmp('min-choose').getValue()) {
console.log('In:' + newValue);
element.suspendEvents();
element.setValue('*/'+ newValue);
element.resumeEvents();
}


console.log('new:' + newValue + ' OldValue:' + oldValue);
}
}
It doesn't work well I have a lot of calls for the 'change'

mitchellsimoens
15 Oct 2012, 6:45 AM
So each row that is selected you want a prefix to them?

mmuruev
16 Oct 2012, 3:47 AM
exactly

mitchellsimoens
16 Oct 2012, 4:01 AM
If it's going to be the same in all records then you can use the convert method in the model. Or you can iterate through the values to add it. You can extend it and override the getValues method