Hybrid View

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    19
    Vote Rating
    0
    manyu.tomar is on a distinguished road

      0  

    Default [closed] [Ext JS 4.0.2a]itemselector not reloading the store

    [closed] [Ext JS 4.0.2a]itemselector not reloading the store


    i need to dynamically generate the items in the itemselector with the reloading of store ,in ext 3 it is working perfectly but for some reason in extjs 4 the itemselector store does not accept new data into it with reloading of store .
    please suggest how can i reload the itemselecttor store after it has been rendered .

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    19
    Vote Rating
    0
    manyu.tomar is on a distinguished road

      0  

    Default


    solved the problem after some going through its doc. , used the method bindStore() , to reload the store dynamically to the itemselector .
    it would be done like this .

    var itemsel = Ext.create('Ext.ux.form.ItemSelector',{
    fieldLabel: 'FieldSelector',
    imagePath: 'ext4/ux/images/',
    store: ds,
    ..//ur config options
    });
    then , to reload store use ...
    itemsel.bindStore(newstore);



  3. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Germany
    Posts
    1
    Vote Rating
    0
    Schnueggel is on a distinguished road

      0  

    Default


    reloading/refreshing store doesn't work for me too , i used this.

    myitemselector.fromField.store.load();

  4. #4
    Sencha Premium Member louiscooper's Avatar
    Join Date
    Mar 2012
    Location
    Austin, TX
    Posts
    30
    Vote Rating
    1
    louiscooper is on a distinguished road

      0  

    Default bindStore()

    bindStore()


    You saved my life!!

    itemsel.bindStore(newstore);

  5. #5
    Sencha User
    Join Date
    Dec 2012
    Posts
    2
    Vote Rating
    0
    atifhasan is on a distinguished road

      0  

    Default


    I am also trying to reload itemselector on another combobox select but its not working for me.

    bindStore() is acting weird. Its always loading data from previous filter. For example

    If first value that I select in cbo1 is USA
    itemselector: shows nothing

    When I change cbo1 value to UK
    now itemselector shows the filtered cities from USA (hence from previous filter)

    when i change cbo1 value to Germany
    now itemselector shows the filtered cities from UK (from previous filter again)

    and so on. So item selector is always a step behind showing values from previous filter operation. Here is my code

    PHP Code:
    items: [
                    {
                        
    xtype'combobox',
                        
    anchor'100%',
                        
    id'adminpfformreport',
                        
    name'adminpfformreport',
                        
    maxWidth400,
                        
    fieldLabel'<b>Reports</b>',
                        
    allowBlankfalse,
                        
    queryMode'local',
                        
    blankText'You must select Report to proceed',
                        
    displayField'layout',
                        
    store'Report',
                        
    valueField'layout',
                        
    listeners: {
                            
    select: function(cbo,mixedValue){
                                
                               
    adminpfstore Ext.getCmp('adminpfformaccounts').store
                               
    adminpfstore.load({
                                  
    params: {'layout'cbo.getValue()}
                               });
                               
    Ext.getCmp('adminpfformaccounts').bindStore(adminpfstore); 
                               
    console.log(adminpfstore);
                                
                                
                            }
                        }
                    },
                    {
                        
    xtype'itemselector',
                        
    name'adminpfformaccounts',
                        
    id'adminpfformaccounts',
                        
    anchor'100%',
                        
    fieldLabel'<b>Portfolios</b>',
                        
    imagePath'../extjs/ux/images/',
                        
    triggerAction'all',
                        
    queryMode'remote',

                        
    store'AdminPortfolio' ,
                        
    displayField'portfolio',
                        
    valueField'portfolio',
                        
    value: [],

                        
    allowBlankfalse,
                        
    msgTarget'side'
                    
    }                 
                ] 
    My store's constructor is

    PHP Code:
    constructor: function(cfg) {
            var 
    me this;
            
    cfg cfg || {};
            
    me.callParent([Ext.apply({
                
    autoLoadfalse,
                
    storeId'adminportfolio',
                
    model'RiskDashboard.model.Portfolio',
                
    proxy: {
                    
    type'ajax',
                    
    url'cfcs/riskdashboard.cfc?method=getAvailablePFList',
                    
    reader: {
                        
    type'json',
                        
    root'ROWS',
                        
    successProperty'SUCCESS',
                        
    totalProperty'TOTAL'
                    
    },
                    
    listeners: {
                        
    exception: {
                            
    fnme.onAjaxproxyException,
                            
    scopeme
                        
    }
                    }
                }
            }, 
    cfg)]);
        }, 
    I am checking ajax calls and store is loading/filtering correct data

    What am I missing?

  6. #6
    Ext Premium Member yyogev's Avatar
    Join Date
    Jun 2009
    Location
    Shoham, Israel
    Posts
    196
    Vote Rating
    6
    yyogev is on a distinguished road

      0  

    Thumbs up Solved this

    Solved this


    fix in function populateFromStore:
    Code:
    Index: ItemSelector.js
    ===================================================================
    RCS file: /arch/cvs/it/lib/extjs/ux/ItemSelector.js,v
    retrieving revision 1.2
    diff -c -r1.2 ItemSelector.js
    *** ItemSelector.js	21 Apr 2013 13:20:45 -0000	1.2
    --- ItemSelector.js	21 Apr 2013 13:32:09 -0000
    ***************
    *** 352,358 ****
              // Flag set when the fromStore has been loaded
              this.fromStorePopulated = true;
      
    !         fromStore.add(store.getRange());
      
              // setValue waits for the from Store to be loaded
              fromStore.fireEvent('load', fromStore);
    --- 352,358 ----
              // Flag set when the fromStore has been loaded
              this.fromStorePopulated = true;
      
    !         fromStore.loadData(store.getRange());
      
              // setValue waits for the from Store to be loaded
              fromStore.fireEvent('load', fromStore);
    Yaron Yogev

    IT Software Developer