Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2011
    Posts
    29
    Vote Rating
    0
    binarious is on a distinguished road

      0  

    Default Select Mask doesn't disappear when manipulating Select Field in Store's onLoad event

    Select Mask doesn't disappear when manipulating Select Field in Store's onLoad event


    REQUIRED INFORMATION




    Sencha version tested:
    • Sencha Touch 2 (Sencha Designer built-in)
    Browser versions tested against:
    • Chrome 19
    • Chrome 17
    • Safari 5
    DOCTYPE tested against:
    • HTML5
    Description:
    • When changing the hidden state of a select field from a store's load function, a previously opened select mask doesn't disappear.
    Steps to reproduce the problem:
    • create 2 select boxes, the 2nd one hidden
    • in the onChange of the first one, load the 2nd one's store
    • In the onLoad of the second one's store, set the select box to hidden = false
    The result that was expected:
    • select mask of the first box disappears
    • second select box appears
    The result that occurs instead:
    • select mask doesn't disappear
    • second select box appears
    Test Case:

    Inside a controllers init function:
    Code:
     var that = this;
     Ext.getStore('MyStore').on({
        load: function() {
            console.log("Got elements: " + that.get2ndSelect().getStore().getCount());
    
    
            if(that.get2ndSelect().getStore().getCount() > 1) {
                that.get2ndSelect().show();
            } else {
                that.get2ndSelect().hide();
            }
    
    
        }
    });
    The onChange event of the first select box:
    Code:
    var store = Ext.getStore('MyStore');
    
    
    store.getProxy().setUrl('whereever');
    
    
    store.load();
    store.clearFilter();




    HELPFUL INFORMATION




    Screenshot or Video:
    • http://www.screenr.com/FB78 (it shows that the initial onLoad works, but when calling it from a onChange event of a SelectBox it fails)
    See this URL for live test case: I don't want to make this public. If I get an email address I could send you the link for the live test case.




    Debugging already done:
    • no js errors
    Possible fix:
    • not provided
    Additional CSS used:
    • only default
    Operating System:
    • Mac OS X Lion
    Last edited by mitchellsimoens; 7 Mar 2012 at 6:14 AM. Reason: formatting and a hint
    -->

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    847
    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


    I created this simple example I think is what would show the error but using the GA release from yesterday I don't see an error:

    Code:
    new Ext.Container({
        fullscreen : true,
        items      : [
            {
                xtype   : 'selectfield',
                label   : 'Choose one',
                options : [
                    { text : 'First Option',  value : 'first'  },
                    { text : 'Second Option', value : 'second' },
                    { text : 'Third Option',  value : 'third'  }
                ],
                listeners : {
                    change : function(field) {
                        var container = field.up('container'),
                            fields    = container.query('selectfield'),
                            store     = fields[1].getStore();
    
                        store.on('load', function(s) {
                            if (s.getCount() > 1) {
                                fields[1].show();
                            } else {
                                fields[1].hide();
                            }
                        });
    
                        store.load();
                    }
                }
            },
            {
                xtype   : 'selectfield',
                label   : 'Choose one',
                hidden  : true,
                store   : new Ext.data.Store({
                    fields : ['text', 'value'],
                    proxy  : {
                        type   : 'ajax',
                        url    : 'data/json.json',
                        reader : 'json'
                    }
                })
            }
        ]
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.
    -->

  3. #3
    Ext GWT Premium Member
    Join Date
    Oct 2011
    Posts
    29
    Vote Rating
    0
    binarious is on a distinguished road

      0  

    Thumbs up


    Thanks for your testcase.
    I have tested my example with the GA and it works. Seems like this guy needs to be updated: http://extjs.cachefly.net/touch/senc...h-all-debug.js
    -->

  4. #4
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Quote Originally Posted by binarious View Post
    Thanks for your testcase.
    I have tested my example with the GA and it works. Seems like this guy needs to be updated: http://extjs.cachefly.net/touch/senc...h-all-debug.js
    Yes, the Designer version is being updated to use the final Touch 2 build. They should have an update out very soon.

    Sencha Inc

    Jamie Avins

    @jamieavins
    -->