Not able to set value for Ext.ux.form.MultiSelect in ExtJs 3.4

668 Views Asked by At

I am using ExtJs 3.4.

When i set value to Ext.ux.form.MultiSelect, I am getting this error.

"Uncaught TypeError: Cannot read property 'clearSelections' of undefined in MultiSelect.js:245".

If I have to clear the selected values in "Ext.ux.form.MultiSelect" before setting the selected values, then how can i do that.

Please give suggestions for this.

1

There are 1 best solutions below

0
On

If you mean this component, then in setValue method there is call to this.view.clearSelections(), and that probably causes issues. view is created in onRender method. So your combo is probably not rendered when you call setValue.

I see 3 solutions:

  1. Ensure combo is rendered when you call setValue
  2. Check is combo is rendered; call setValue when it is, assign value when it isn't
  3. Override MultiSelect and fix it