[CLOSED] MultiCombo with SelectionMode=all not allowing uncheck

  1. #1

    [CLOSED] MultiCombo with SelectionMode=all not allowing uncheck

    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Panel runat="server">
            <Items>
                 <ext:MultiCombo ID="MultiCombo1" runat="server" SelectionMode="All" Width="260">
                <Items>
                    <ext:ListItem Text="Item 1" Value="1" />
                    <ext:ListItem Text="Item 2" Value="2" />
                    <ext:ListItem Text="Item 3" Value="3" />
                    <ext:ListItem Text="Item 4" Value="4" />
                    <ext:ListItem Text="Item 5" Value="5" />
                </Items>
                
                <SelectedItems>
                    <ext:ListItem Value="2" />
                    <ext:ListItem Index="4" />
                </SelectedItems>
            </ext:MultiCombo>
            </Items>
        </ext:Panel>
       
        </form>
    </body>

    When I use the above code and try to uncheck a row it looses its highlight but the checkbox does not become unchecked
    Last edited by Daniil; Dec 18, 2013 at 2:53 AM. Reason: [CLOSED]
  2. #2
    I cannot reproduce it with latest code, try to update from SVN and retest
  3. #3
    Hi I am using Release version 2.2 and I am 2 weeks from release. So I cannot change my version
  4. #4
    Hello!

    Try to apply the following overriding:

    <script>
        Ext.override(Ext.net.MultiCombo, {
            getPicker: function () {
                if (!this.picker) {
                    this.listConfig = this.listConfig || {};
    
                    if (!this.listConfig.getInnerTpl) {
                        this.listConfig.getInnerTpl = function (displayField) {
                            return '<div class="x-combo-list-item {[this.getItemClass(values)]}">' +
                                    '<div class="x-mcombo-text">{' + displayField + '}</div></div>';
                        };
                    }
    
                    this.listConfig.selModel = {
                        mode: 'SIMPLE'
                    };
    
                    this.picker = this.createPicker();
    
                    this.mon(this.picker.getSelectionModel(), 'select', this.onListSelect, this);
                    this.mon(this.picker.getSelectionModel(), 'deselect', this.onListDeselect, this);
    
                    this.picker.tpl.getItemClass = Ext.Function.bind(function (values) {
                        var record,
                            //fieldValue = this.getValue(),
                            searchValue,
                            selected;
    
                        if (this.selectionMode === "selection") {
                            return "";
                        }
    
                        Ext.each(this.store.getRange(), function (r) {
                            // do not replace == by ===
                            if (r.get(this.valueField) == values[this.valueField]) {
                                record = r;
                                return false;
                            }
                        }, this);
    
                        selected = record ? this.picker.getSelectionModel().isSelected(record) : false;
    
                        /*if (record && !selected && !this.picker.viewReady) {
                            searchValue = record.get(this.valueField);
                            Ext.each(fieldValue, function (v){
                                if (searchValue == v) {
                                    selected = true;
                                    return false;
                                }
                            });         
                        }*/
    
                        if (selected) {
                            return "x-mcombo-item-checked";
                        }
    
                        return "x-mcombo-item-unchecked";
    
                    }, this, [], true);
    
    
                    if (this.selectionMode !== "checkbox") {
                        this.picker.on("render", function () {
                            this.picker.overItemCls = "x-multi-selected";
                        }, this);
                    }
    
                    this.picker.on("viewready", this.onViewReady, this, { single: true });
                }
    
                return this.picker;
            },
                
            onListSelect: function (model, record) {
                if (!this.ignoreSelection) {
                    this.selectRecord(record);
                }
            },
    
            onListDeselect: function (model, record) {
                if (!this.ignoreSelection) {
                    this.deselectRecord(record);
                }
            }
        });
    </script>

Similar Threads

  1. NumberField "TrimTrailedZeros" allowing the left 0
    By Elyfran Vaz in forum 2.x Help
    Replies: 0
    Last Post: Mar 06, 2013, 4:32 PM
  2. Uncheck Checkbox
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Feb 01, 2011, 4:31 PM
  3. Replies: 4
    Last Post: Dec 02, 2010, 1:44 PM
  4. [CLOSED] Allowing double click on Grid Row
    By macap in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 03, 2010, 5:32 PM
  5. how to uncheck radio
    By salihb in forum 1.x Help
    Replies: 1
    Last Post: Oct 19, 2009, 5:42 AM

Posting Permissions