1. #11
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default


    yeah this works using queryMode : 'remote' but it if you already loaded the store ? there no reason to load it again, thats why im using querymode: local.

    it seems like doing store.load() triggers some errors in combobox,
    well for now ill be using queryMode : 'remote' only + not loading store before user clicks the combobox

  2. #12
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default


    Quote Originally Posted by evant View Post
    Probably doesn't make any difference in this case, but if you create multiple instances it means they will all share the same store instance.
    when you set the store in a component like store : 'someString'
    it uses 1 single store instance, if im not wrong the only diference doing store: myStore Vs store : 'myStore' is that the first just set the store with that instance, the second will look for a instance with storeId : 'myStore' wich is the same.


    as i know (and tested) this two codes are equivalent
    Code:
    var acrStore = Ext.create('store.ACR');
        Ext.define('combo.ACR', {
            extend: 'Ext.form.ComboBox',
            store : acrStore,
           ... other configs ....  
        });
    Code:
        Ext.create('store.ACR',{storeId:'acrStore'});
        
        Ext.define('combo.ACR', {
            extend: 'Ext.form.ComboBox',
            store : 'acrStore',
           ... other configs ....  
        });
    setting the store in a component definition (Ext.define) means all instances of that componet will use the same instance of the store, doing store: 'myStore' doesnt mean 'myStore' points to store definition, means 'myStore' is a instance of a store which has its storeId set to 'myStore'.


    (sorry for my english :d)

  3. #13
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,604
    Vote Rating
    325
    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


    To use different instances of the store on each combobox you can do something like this:

    Code:
    Ext.define('MyStore', {
        extend: 'Ext.data.Store',
        alias: 'store.mystore',
        ...
    });
    
    Ext.define('combo.ACR', {
        extend: 'Ext.form.field.ComboBox',
        store: {type: 'mystore'},
        ...
    });

  4. #14
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default


    very nice skirtle, where is the documentation for such declaration ? {type: "someStore"}

  5. #15
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,604
    Vote Rating
    325
    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'm not sure where it's documented. I found it in the code.

    You can see the aliases for the standard store types in the docs. If, for example, you go to the ArrayStore docs you'll see it says 'store: array' at the top of the docs. That corresponds to this in the code:

    Code:
    Ext.define('Ext.data.ArrayStore', {
        extend: 'Ext.data.Store',
        alias: 'store.array',
        ...

  6. #16
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default


    yeah almost all Ext classes have alias, is just another name to use them, but that says nothing bout setting a store with a object that has a property type, didnt had time to test this, ill check later, thanks for your answer tho

  7. #17
    Ext JS Premium Member
    Join Date
    Jun 2011
    Location
    Ottawa, Ontario, Canada
    Posts
    123
    Vote Rating
    1
    whalethewise is on a distinguished road

      0  

    Default


    I have the same issue when I loadRawData into ComboBox store I need double click on item to select it and combobox doesnt fire any event after that.

    Anybody know of any fix available?

    Thanks

  8. #18
    Sencha User
    Join Date
    Sep 2009
    Posts
    44
    Vote Rating
    0
    ironandsteel is on a distinguished road

      0  

    Default


    For some reason, if I use querymode remote, then my combo works ok. I see the loading mask on my dropdown list the first time, and it is cached thereafter. When I set it to querymode local, it was requiring a double-click to make a selection and close the window, and at some point in my code experiments, I was getting no select event at all. Something is messed up with combobox...

  9. #19
    Sencha User aw1zard2's Avatar
    Join Date
    Sep 2009
    Location
    Dallas, Texas
    Posts
    577
    Vote Rating
    32
    aw1zard2 has a spectacular aura about aw1zard2 has a spectacular aura about

      0  

    Default


    I'm just curious after you init the combobox if you do combobox.getStore().load(); does this behave normally or does the combobox do the double click to hide the list? Might also try the the getStore().load() in the onReady and see if it behaves the same.

    I don't use the onReady no more in 4+ development, I use the launch for Applications.
    I wouldn't use the onReady for defining the components just put them above it.
    But I would use the onReady/launch for preloading combos and various things.

    Since the Ext.onReady means all components are done initializing and dom/css is done.
    After that you can load combo's, show screens, and etc. Even in 3.x I didn't set components in the onReady.

  10. #20
    Ext JS Premium Member
    Join Date
    Jun 2011
    Location
    Ottawa, Ontario, Canada
    Posts
    123
    Vote Rating
    1
    whalethewise is on a distinguished road

      0  

    Default


    I use loadRawData() on my store becasue chunk of data loaded with separate ajax call.

    It was working in 4.0.7.