PDA

View Full Version : ext.ux.form.MultiSelect - This.view



kuthz
2 Mar 2010, 7:50 AM
I have a problem with the multiselect extension with Ext 3.X

I populated the multiselect object in a tabpanel without loading the store. The multiselect is disabled by default and the tab is disabled too.

I got the error in firedebug this.view.getSelectedIndexes(); is undefined, this error repeat every second.

When the user select and particularly option I enabled the multiselect and load the store and this error disapear.

To get rid of this error I apply this "patch" in the getValue function


getValue: function(valueField){
var returnArray = [];
if(this.view)
{
var selectionsArray = this.view.getSelectedIndexes();
if (selectionsArray.length == 0) {return '';}
for (var i=0; i<selectionsArray.length; i++) {
returnArray.push(this.store.getAt(selectionsArray[i]).get((valueField != null) ? valueField : this.valueField));
}
}
return returnArray.join(this.delimiter);
},

kuthz
5 Mar 2010, 11:20 AM
The multiselect keep the selected value after a store load.

I added this line of code



this.store.on('load', this.onLoad, this);


// private
onLoad: function (store, records, options) {
this.hiddenField.dom.value = this.getValue();
},