1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    16
    Answers
    1
    Vote Rating
    1
    naimjs is on a distinguished road

      0  

    Question Answered: [4.0.7] ComboBox bug with load mask

    Answered: [4.0.7] ComboBox bug with load mask


    combo_mask.JPG
    my config:
    var store = Ext.create('Ext.data.Store',{
    model: 'News',
    proxy: {
    type: 'ajax',
    url: 'myurl/news',
    reader: {
    type: 'json',
    root: 'data'
    }
    },
    autoLoad: true
    });

    combo = {
    xtype: 'combo',
    queryMode: 'local',
    store: 'mystore',
    valueField: 'id',
    displayField: 'subject',
    value: 47
    }

    after load data from the server in the second time, the LoadMask do not disappear and still until refresh page,
    I am using Firefox and Chrome browser.
    is it a bug or my config is wrong?

  2. This is a 4.0.7 bug, seems to be solved in 4.1pr

    My override
    PHP Code:
    Ext.override(Ext.LoadMask, {
          
    onHide: function() { this.callParent(); }
    }); 

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,596
    Answers
    542
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I wasn't able to reproduce your problem using the code you provided.

    Are you getting an error message in the console?

  4. #3
    Sencha User
    Join Date
    Aug 2009
    Posts
    16
    Answers
    1
    Vote Rating
    1
    naimjs is on a distinguished road

      0  

    Default


    I appreciate you for your answer, my problem is still the same but I will put here clear example to show you exactly what is happen, I used almost the same example in the extjs examples (ComboBox Templates)

    Code:
    Ext.define("Post", {
                extend: 'Ext.data.Model',
                fields: [
                    {name: 'id', mapping: 'post_id'},
                    {name: 'title', mapping: 'topic_title'},
                    {name: 'topicId', mapping: 'topic_id'},
                    {name: 'author', mapping: 'author'},
                    {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
                    {name: 'excerpt', mapping: 'post_text'}
                ]
            });
    
    ds = Ext.create('Ext.data.Store', {
                model: 'Post',
                proxy: {
                    type: 'jsonp',
                    url : 'http://www.sencha.com/forum/topics-remote.php',
                    reader: {
                        type: 'json',
                        root: 'topics'
                    }
                }            
    });
    
    Ext.create('Ext.panel.Panel', {
                        title: 'Test 1',
                        items: [{
                            xtype: 'combo',
                            store: ds,
                            displayField: 'title',
                            valueField: 'id',
                            width: 300,
                            margin: '10'
                        }, {
                            xtype: 'button',
                            text: 'load',
                            handler: function() {
                                ds.load();
                            }
                        }]
                    })
    please generate this example and you will see what I am meaning, when I call ds.load() many time the problem occurs,
    LoadMask does not disappear inside combobox please open combo and see loadmask

    thank you in advance
    Last edited by naimjs; 27 Oct 2011 at 1:43 AM. Reason: to show my code properly

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,596
    Answers
    542
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Please use [CODE] tags when posting code (# button on the editor toolbar).

    Confirmed, using this example the load mask doesn't hide properly using 4.0.7. It works fine with 4.0.2. I suggest you look in the bugs forum to see whether it has already been reported and file it if it hasn't.

  6. #5
    Sencha User ldrvoderic's Avatar
    Join Date
    Jan 2011
    Location
    Croatia
    Posts
    4
    Vote Rating
    0
    ldrvoderic is on a distinguished road

      0  

    Default


    This is my patch for loadMask bug on combo.

    Code:
    Ext.override(Ext.form.field.ComboBox, { 
        createPicker: function() {
            var me = this,
                picker,
                menuCls = Ext.baseCSSPrefix + 'menu',
                opts = Ext.apply({
                    pickerField: me,
                    selModel: {
                        mode: me.multiSelect ? 'SIMPLE' : 'SINGLE'
                    },
                    floating: true,
                    hidden: true,
                    ownerCt: me.ownerCt,
                    cls: me.el.up('.' + menuCls) ? menuCls : '',
                    store: me.store,
                    displayField: me.displayField,
                    focusOnToFront: false,
                    pageSize: me.pageSize,
                    tpl: me.tpl,
                    loadMask: me.queryMode === 'local' ? false: true
                }, me.listConfig, me.defaultListConfig);
    
            picker = me.picker = Ext.create('Ext.view.BoundList', opts);
            if (me.pageSize) {
                picker.pagingToolbar.on('beforechange', me.onPageChange, me);
            }
    
            me.mon(picker, {
                itemclick: me.onItemClick,
                refresh: me.onListRefresh,
                scope: me
            });
    
            me.mon(picker.getSelectionModel(), {
                'beforeselect': me.onBeforeSelect,
                'beforedeselect': me.onBeforeDeselect,
                'selectionchange': me.onListSelectionChange,
                scope: me
            });
    
            return picker;
        }
    });

  7. #6
    Sencha User lucasguaru's Avatar
    Join Date
    May 2011
    Location
    Guaruj√°, Brazil
    Posts
    77
    Answers
    9
    Vote Rating
    2
    lucasguaru is on a distinguished road

      0  

    Default


    I used the ldrvoderic's patch and it worked.
    Thanks!

  8. #7
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    40
    Vote Rating
    2
    rlegend is on a distinguished road

      0  

    Default


    @ldrvoderic

    Thanks for the patch. This was driving me absolutely nuts.

  9. #8
    Sencha User
    Join Date
    Jun 2010
    Location
    Buenos Aires, Argentina
    Posts
    213
    Answers
    2
    Vote Rating
    9
    ldonofrio will become famous soon enough

      0  

    Default


    This is a 4.0.7 bug, seems to be solved in 4.1pr

    My override
    PHP Code:
    Ext.override(Ext.LoadMask, {
          
    onHide: function() { this.callParent(); }
    }); 

  10. #9
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    40
    Vote Rating
    2
    rlegend is on a distinguished road

      0  

    Default


    Nice work

  11. #10
    Sencha User
    Join Date
    Aug 2009
    Posts
    16
    Answers
    1
    Vote Rating
    1
    naimjs is on a distinguished road

      0  

    Smile good solution

    good solution


    Great, now loadMask is working with 4.0.7

    thanks for @ldonofrio