ExtJs 4 combobox with checkboxes

后端 未结 2 2128
长情又很酷
长情又很酷 2021-02-04 15:23

I\'m looking for EXTJS4 combobox control which allows selecting multiple items via checkboxes inside.

Actually I need this control http://lovcombo.extjs.eu/ but it is i

2条回答
  •  情话喂你
    2021-02-04 15:51

    Multiselect combo with checkbox in ExtJS4.0 can be achieved with addition few lines of code.

    Basically you need to make use of the existing css class which get applied during selection and deselection of an item and pushing an image (checkbox image) at that time accordingly.

    "x-boundlist-item" and "x-boundlist-selected" are the classes taken from ext-all.css.

    
    
    
    Ext.create('Ext.form.ComboBox', {
            id: 'BCCAddress',
            name: 'BCCAddress',
            maxHeight: 150,        
            width: 210,
            multiSelect: true,
            emptyText : "Select Bcc email addresses",
            renderTo: 'extBCCAddress',
            store: myArrayStore,
            displayField: 'fieldName',
            valueField: 'fieldName',
            forceSelection: true,
            editable: false,
            mode: 'local',
            triggerAction: 'all',
            listConfig : {          
                getInnerTpl : function() {
                    return '
    {fieldName}
    '; } } });

    [below is an image of this custom component]
    enter image description here

提交回复
热议问题