1. #1
    Sencha Premium Member
    Join Date
    Nov 2007
    Location
    Germany
    Posts
    181
    Vote Rating
    0
    Michi_72 is on a distinguished road

      0  

    Default Ext: 4.1 RC1: Itemselector and Remote-Store

    Ext: 4.1 RC1: Itemselector and Remote-Store


    Hello,

    i try to load json-Data from a remote-Store to an itemselector. But nothing is shown in the itemselector.

    Trying to bind the store to the itemselector was not successfully.

    I have tried like this:

    PHP Code:
    ds1.load(function(){ Ext.getCmp('is').bindStore(ds1); }); 
    After looking in the sourcecode of ItemSelector.js i saw:

    PHP Code:
    onBindStoreExt.emptyFn 
    .

    I think there is missing something in 4.1 RC1 or am i wrong?

    Any tips for me?

    Thanks in advance.

    Michi

  2. #2
    Sencha User iomanip's Avatar
    Join Date
    Jul 2008
    Location
    El Salvador
    Posts
    32
    Vote Rating
    0
    iomanip is on a distinguished road

      0  

    Default


    You're a lucky one!! I had the same problem... and binding the store everytime you load it was the solution in the forum... but didn't work for me. Perhaps you should try this:

    PHP Code:
    var storeCountries Ext.create('Ext.data.Store', {
        
    id'storeCountries',
        
    model'modelCtrSk',
        
    remoteSortfalse,
        
    remoteFilterfalse,
        
    remoteGroup:false,
        
    proxy: {
            
    type'ajax',
            
    url'queryHarvestAreaAction.do?accion=loadCountries',
            
    reader: {
                
    type'json',
                
    root'registers'
            
    }
        },
        
    autoLoadfalse
    });

    tmpStore.load({
        
    scope:this,
        
    callback:function(recordsoperationsuccess){
            
            if(
    success){
           
    //"countries" it's a itemselector
                
    var tmpCountries Ext.getCmp('countries');
                
    tmpCountries.clearValue();
                
                if(
    tmpCountries.store.getCount()>0){
                    
    //Remove elements from "From Available BindList"
                    
    tmpCountries.fromField.store.removeAll();
                }
                
    //copy from data loaded from my principal store to the ItemSelector's main store
                
    tmpCountries.store.add(storeCountries.getRange());
                
                
    //Also copy data to Available Item Store
                
    tmpCountries.fromField.store.add(storeCountries.getRange());
            }
        }
    }); 
    Voila!!! works for me.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2007
    Location
    Germany
    Posts
    181
    Vote Rating
    0
    Michi_72 is on a distinguished road

      0  

    Default Re

    Re


    Hello,

    thanks for your help! That works for me too.

    I hope the source will be corrected so that bindStore works like it should!

    Thanks!

    Michi

Thread Participants: 1