7
votes

In the ExtJS 3.3.1, I tried to make comboBox to multi select , but it doesn't work.

Please help.

 var mArray = new Array("ALL", "AAA", "BBB");
        var mCombo = new Ext.form.ComboBox({ id: 'ID', fieldLabel: 'ID',
            triggerAction: 'all',
            height: 100, width: 163,
            multiSelect: true,
            store: mArray
        });
        Ext.getCmp('mCombo').setValue("ALL");
2

2 Answers

10
votes

There isn't a config option like multiSelect in Ext.form.ComboBox.
To get desired functionality you either need to develop a multiselect combobox by your own or use one of existing alternatives, like Ext.ux.form.CheckboxCombo, Ext.ux.form.SuperBoxSelect and Ext.ux.form.LovCombo.

-1
votes
return new Ext.form.ComboBox({
                            fieldLabel: fieldLabel,
                            hiddenName: name,
                            store: store ,
                            valueField:'value',
                            displayField:'value',
                            typeAhead: true,
                            mode: 'local',
                            triggerAction: 'all',
                            emptyText:'Select '+fieldLabel+' ...',
                            selectOnFocus:true,
                            allowBlank:allowBlank,
                            forceSelection : true,
                            disabled:disabled,
                            multiSelect:true,
                            width:200,
                            id:id,
                            listeners:{
                                change : function( frm, newValue, oldValue ) {
                                    doRenderTL();
                                }
                            },
                            renderTo: Ext.get( renderTo )
                        });