1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    6
    Vote Rating
    -1
    tharahan is an unknown quantity at this point

      0  

    Default Unanswered: Create a Store from a subset of JSON Store

    Unanswered: Create a Store from a subset of JSON Store


    Hi

    I have a json store defined as follows

    var subAccountStore = new Ext.data.JsonStore({
    autoLoad: true,
    proxy: {
    type:'ajax',
    url : '/opUI/json/subaccount.action?name="ABC"'
    },
    fields: ['accountName', 'quantity','accountNumbers'],
    listeners: {
    load: function(store, records, success) {
    // ???????
    },
    single: true
    }

    });

    and sample data is

    [{"accountName":"'ABC'","quantity":100,"accountNumbers":['12345A','12345B','12345C']},{"accountName":"'XYZ'","quantity":100,"accountNumbers":['99999A','99999B','99999C']}]

    How do I create a store dynamically for "accountNumbers" and assign to combo box inside the grid?

    Thanks
    Tharahan

  2. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    275
    Answers
    3
    Vote Rating
    10
    worthlutz is on a distinguished road

      0  

    Default


    Try defining your data using several models and use the "hasMany" association for the accountNumbers.

    Code:
    Ext.define('MyApp.model.AccountNumbers',
        fields: [
            { name: 'accountNumber'
            }
        ],
        belongsTo: 'MyApp.model.Accounts',
    );
    
    Ext.define('MyApp.model.Accounts',
        fields: [
            { name: 'accountNumber' },
            { name: 'quantity'}
        ],
        hasMany: {
            name: 'accountNumbers',
            model: 'myApp.model.AccountNumber'
        }
    );
    I'm not sure I've got the code correct but you should get the idea.
    Check the docs: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Model

    Worth

Thread Participants: 1

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