Hybrid View

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9074 in a recent build.
  1. #1
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default Combo with store triggers store load, without autoLoad

    Combo with store triggers store load, without autoLoad


    When a store is assigned to a Combo, the store is loaded, even though the store should not autoLoad.
    A filter is also applied, it includes the data-index av property, but no value.

    When the same store is assigned to more than one combo the store is loaded several times, each store ads a filter.

    Know issue?
    I've tested with several versions, latest is with 4.2.0.540
    Sven Tore Iversen

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


    This code:

    Code:
    var store = new Ext.data.Store({
        fields : ['text', 'value'],
        proxy  : {
            type : 'ajax',
            url  : 'data/json.json'
        }
    });
    
    new Ext.form.Panel({
        renderTo : document.body,
        items    : [
            {
                xtype        : 'combobox',
                fieldLabel   : 'Test',
                store        : store,
                displayField : 'text',
                valueField   : 'value'
            }
        ]
    });
    Using last night's nightly (also tested 4.2.0.489 = 4.2.0 RC1) it doesn't load the store until I click on the trigger or type in the box.
    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
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default


    After some more testing I've found that you have to add set remoteFilter:true so see the problem.

    Still there in 625
    Sven Tore Iversen

  4. #4
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      0  

    Default


    Is this marked as a bug?
    Sven Tore Iversen

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Quote Originally Posted by svenna View Post
    When a store is assigned to a Combo, the store is loaded, even though the store should not autoLoad.
    A filter is also applied, it includes the data-index av property, but no value.

    When the same store is assigned to more than one combo the store is loaded several times, each store ads a filter.

    Know issue?
    I've tested with several versions, latest is with 4.2.0.540
    It's an application error to use the same store in multiple combos.

    Obviously, each will add its own filter, so you really can't do this.

  6. #6
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    407
    Vote Rating
    18
    svenna will become famous soon enough svenna will become famous soon enough

      1  

    Default


    OK, but ignore the multiple combos, then.
    In 4.1 I could use the same store on multiple combos just fine.

    The error is there with just one combo.
    The problem, really, is that when the combo adds the filter to the store the store is loaded, even though the store is autoLoad:false if the store has remoteFilter:true.

    Why does the combo add a filter to the store? The filter data only contains a property, not a value. The value is not sent to the server as a part of the filter, it is sent as a query parameter.


    This code should NOT trigger a request:

    Code:
    <script type="text/javascript">
    	Ext.onReady(function(){
    
    		Ext.define('User', {
    			extend: 'Ext.data.Model',
    			fields: [
    				{name: 'login',  type: 'string'},
    				{name: 'name',   type: 'string'}
    			]
    		});
    
    		var store = new Ext.data.Store({
    			model:'User',
    			proxy: {
    				type: 'rest',
    				url: 'http://www.example.com/rest/users/',
    			},
    			remoteFilter: true,
    			autoLoad:false
    		});
    
    		var combo = new Ext.form.ComboBox({
    			renderTo:'combo',
    			store: store,
    			displayField:'name',
    			valueField:'login'
    		});
    	});
    </script>
    
    
    <div id="combo"></div>
    The above code trigger a request to:
    Code:
    http://www.example.com/rest/users/?_dc=1363019458867&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22name%22%7D%5D  
    
    _dc:1363019458867
    page:1
    start:0
    limit:25
    filter:[{"property":"name"}]
    When writing "test" in the combo it triggers:
    Code:
    _dc:1363019723543
    query:test
    page:1
    start:0
    limit:25
    filter:[{"property":"name"}]
    The later is "ok" although i would prefer if "test" was a value property in the filter to allow it to use the same filtering logic as all other store filters.

    Is this really the intended behavior?
    It triggers to many problematic request for the backend. The server does not currently accept "filter" with only property and no "value". Also sending "all data" for every combo using the same data on opening the application is simply to slow. In my application the user will always search, and the store always gets additional filters before they are loaded.
    Sven Tore Iversen

  7. #7
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    503
    Vote Rating
    47
    tangix has a spectacular aura about tangix has a spectacular aura about tangix has a spectacular aura about

      1  

    Default


    Quote Originally Posted by Animal View Post
    It's an application error to use the same store in multiple combos.
    Obviously, each will add its own filter, so you really can't do this.
    Sorry for asking a stupid question;
    in 4.1.3 I had three different combos in different forms all running with the same local ArrayStore containing a list of countries (and also three combos with US States). To avoid massive duplication of static array data and memory overhead - how should I do this in 4.2.0? Creating three different stores all containing the same 300+ countries and 50 states seems a bit... stupid, for lack of other words.

    Thanks,
    /Mattias

  8. #8
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    The problem is filtering. If a combobox applies a filter because you typed "Gre", to find "Great Britain", then the store that it thinks it owns is filtered. And other comboboxes which use that store will see the data filtered according to that.

    Can you see this happening when you run your app?

  9. #9
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    503
    Vote Rating
    47
    tangix has a spectacular aura about tangix has a spectacular aura about tangix has a spectacular aura about

      0  

    Default


    Quote Originally Posted by Animal View Post
    Can you see this happening when you run your app?
    Yep! So, what is the recommended approach to handle this?

    I have now duplicated the store three times for country and state so instead of 2 stores I have 6. Each store loaded with 5kB + 2kB data - there's got to be a better way!
    Last edited by tangix; 18 Mar 2013 at 8:02 AM. Reason: Added more info

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Possibly override onBlur and onFocus to remove and re-add the queryFilter back to the store.

    The idea being that only one item can be focused, so only one can apply a filter during the time it is focused.

    That's just a concept. I have not dug into the code to check whether it is that easy. I think we should probably do this to enable sharing though. I agree it is silly to have to create several identical stores.

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