1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    15
    Vote Rating
    0
    madsovenielsen is on a distinguished road

      0  

    Default Unanswered: Ext.List - JSON

    Unanswered: Ext.List - JSON


    Hello

    Is it possible to use JSON as the data format in a Ext.List ?

    Example from http://docs.sencha.com/touch/1-1/#!/api/Ext.List
    Code:
    Ext.regModel('Contact', {
        fields: ['firstName', 'lastName']
    });
    
    var store = new Ext.data.JsonStore({    model  : 'Contact',
        sorters: 'lastName',
    
        getGroupString : function(record) {
            return record.get('lastName')[0];
        },
    
        data: [
            {firstName: 'Tommy',   lastName: 'Maintz'},
            {firstName: 'Rob',     lastName: 'Dougan'},
            {firstName: 'Ed',      lastName: 'Spencer'},
            {firstName: 'Jamie',   lastName: 'Avins'},
            {firstName: 'Aaron',   lastName: 'Conran'},
            {firstName: 'Dave',    lastName: 'Kaneda'},
            {firstName: 'Michael', lastName: 'Mullany'},
            {firstName: 'Abraham', lastName: 'Elias'},
            {firstName: 'Jay',     lastName: 'Robinson'}
        ]
    });
    
    var list = new Ext.List({
        fullscreen: true,
        
        itemTpl : '{firstName} {lastName}',
        grouped : true,
        indexBar: true,
        
        store: store
    });
    list.show();
    So something like this instead:

    Code:
    Ext.regModel("Contact", {
        fields: ["firstName", "lastName"]
    });
    var store = new Ext.data.JsonStore({
        model  : "Contact",
        sorters: "lastName",
        getGroupString : function(record) {
            return record.get("lastName")[0];
        },
        data: [
            {"firstName": "Tommy",   "lastName": "Maintz"},
            {"firstName": "Rob",     "lastName": "Dougan"},
            {"firstName": "Ed",      "lastName": "Spencer"},
            {"firstName": "Jamie",   "lastName": "Avins"},
            {"firstName": "Aaron",   "lastName": "Conran"},
            {"firstName": "Dave",    "lastName": "Kaneda"},
            {"firstName": "Michael", "lastName": "Mullany"},
            {"firstName": "Abraham", "lastName": "Elias"},
            {"firstName": "Jay",     "lastName": "Robinson"}
        ]
    });
    var list = new Ext.List({
        fullscreen: true,
        
        itemTpl : "{firstName} {lastName}",
        grouped : true,
        indexBar: true,
        
        store: store
    });
    list.show();
    Any suggestions are very welcome.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    I have not tried this. Have you tried? .. and are you receiving any errors?

    Regards.
    Scott.

  3. #3
    Sencha User
    Join Date
    May 2010
    Posts
    15
    Vote Rating
    0
    madsovenielsen is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    I have not tried this. Have you tried? .. and are you receiving any errors?

    Regards.
    Scott.
    Nope, i dont have a working Sencha environment up and running.

    Kind regards Mads Nielsen

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