You found a bug! We've classified it as EXTJS-8819 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2010
    Location
    Hamburg, Germany
    Posts
    192
    Vote Rating
    6
    winkelmann is on a distinguished road

      0  

    Default Ext.form.field.ComboBox multiSelect:true dirty checking broken

    Ext.form.field.ComboBox multiSelect:true dirty checking broken


    REQUIRED INFORMATION


    Ext version tested:
    • Ext 4.1.3


    Browser versions tested against:
    • Chrome 25
    • FF19


    DOCTYPE tested against:
    • html5


    Description:
    • In a combobox with multiSelect:true the selection order of the items is taken into account for determining the dirty state


    Steps to reproduce the problem:
    • If un-selecting all records in the combobox and re-selecting them in an order not equal to the original value order, dirty stays true


    The result that was expected:
    • Dirty should switch back to false


    The result that occurs instead:
    • Dirty stays true


    Test Case:

    Code:
    Ext.onReady(function(){
    
                Ext.define('ComboBoxTester', {
                    extend: 'Ext.window.Window',
    
                    afterRender: function() {
                        this.callParent();
    
                        this.down('form').getForm().setValues({
                            testField: [1,3]
                        });
    
                    },
    
                    initComponent: function() {
                        var me=this;
    
                        me.items = [{
                            xtype: 'form',
                            trackResetOnLoad: true,
                            items: [{
                                xtype: 'combobox',
                                name: 'testField',
                                fieldLabel: 'testField',
                                store: Ext.create('Ext.data.Store', {
                                    fields: ['id', 'name'],
                                    data: [{
                                        id: 1,
                                        name: 'Testdataset 1'
                                    },{
                                        id: 2,
                                        name: 'Testdataset 2'
                                    },{
                                        id: 3,
                                        name: 'Testdataset 3'
                                    }]
                                }),
                                queryMode: 'local',
                                displayField: 'name',
                                valueField: 'id',
                                typeAhead: false,
                                editable: false,
                                forceSelection: true,
                                multiSelect: true
                            }],
                            listeners: {
                                dirtychange: function(frm, dirty) {
                                    console.log('New dirty flag', dirty);
                                    console.log('Field value', frm.findField('testField').getValue());
                                }
                            }
                        }];
    
                        me.callParent();
                    },
    
                    constructor: function() {
                        this.callParent([{
                            width: 300,
                            height: 200,
                            title: 'Test combobox dirty',
                            layout: 'fit'
                        }]);
                    }
                });
    
                Ext.create('ComboBoxTester').show();
            });


    Debugging already done:
    • Ext.form.field.Field compares the original array value of the multiselect combo box by converting both array to string using String(values) rather than sorting the array first.


    Operating System:
    • Win7 64bit

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Vote Rating
    751
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2010
    Location
    Hamburg, Germany
    Posts
    192
    Vote Rating
    6
    winkelmann is on a distinguished road

      0  

    Default


    I created the following workaround:

    Code:
    Ext.define('Ext.ux.overrides.ComboBox', {
        override: 'Ext.form.field.ComboBox',
    
        isEqual: function(v1, v2) {
            var fromArray = Ext.Array.from,
                i, len;
    
            v1 = fromArray(v1);
            v2 = fromArray(v2);
            len = v1.length;
    
            if (len !== v2.length) {
                return false;
            }
    
            return String(Ext.Array.sort(v1))===String(Ext.Array.sort(v2));
        }
    });
    Maybe this implementation could also be used to implement the actual fix :-)

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar