1. #1
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

    Default Answered: manage store by controller: how to set proxy and load Data() with parameters

    Answered: manage store by controller: how to set proxy and load Data() with parameters


    Hello all,
    I have a Panel view whose data (loaded from a store) depends on a proxy parameter (GET parameter for the json data retrieved). Store has then autoload = false set

    I'm trying then (on the panel activation) to:
    - get store ID
    - set proxy parameter for the store (url)
    - load data (store.load()) if I'm correct
    - take the data and put on the panel HTML


    however there is no way I can have the store filled with data (unless I'm misunderstanding some commands / point of my code)

    here is the example

    store:

    Code:
    Ext.define('app.store.CDetail', {
        extend: 'Ext.data.Store',
    
    
        config: {
            storeId: 'cdetailstore',
            model: "app.model.Data",
    
    
    
    
            proxy: {
                type: 'ajax',
                url: 'www.myserver.com/info.php?task=infodetail&id=1&type=",
                reader: {
                    type: 'json'
                }
            },
            autoLoad: false
        }
    });
    Model:

    Code:
    Ext.define('app.model.Data', {
        extend: 'Ext.data.Model',
        config: {
            fields: [
                {name: 'data', type: 'string'}
            ]
        }
    
    
    });

    Controller:

    Code:
    Ext.define('app.controller.CDetail', {
        extend: 'Ext.app.Controller',
        
        config: {
            refs: {
                CDetail: 'CDetail'
            },
            control: {
                'CDetail': {
                    activate: 'fillDetail'
                }
            }
        },
        fillDetail: function() {
            var store = Ext.getStore('cdetailstore');
            var detailPanel = this.getConferenceDetail();
            var type = detailPanel.config.type;
            store.load();
    
            debugger;
        }
        
    });
    store array data is always 0
    can someone help me please???

    thank you in advance
    alex

  2. 1.the store should have a rootProperty
    2.when load the store you can send params dynamiclly like this:
    Code:
    store.load({
    params: { ... }, callback: function(records, opertion, success) { ... }, scope: this
    });

  3. #2
    Sencha User
    Join Date
    Apr 2012
    Location
    ShenZhen, China
    Posts
    52
    Answers
    11
    Vote Rating
    3
    liaoyiwu is on a distinguished road

      0  

    Default


    1.the store should have a rootProperty
    2.when load the store you can send params dynamiclly like this:
    Code:
    store.load({
    params: { ... }, callback: function(records, opertion, success) { ... }, scope: this
    });

  4. #3
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

    Default


    worked!!! many thanks

    I have finally accessed data with

    records[i].get('data')


    best, Alex

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi