1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Tehran
    Posts
    10
    Vote Rating
    0
    h_ghare is on a distinguished road

      0  

    Default Answered: List with proxy

    Answered: List with proxy


    Hi everybody
    I am developing a simple Sencha Touch 2 sample with MVC structure.
    I want a list view that load a json file and show it. I have listed my code but it doesnt show anything.
    Store :
    Code:
    Ext.define('Phonebook.store.Contacts', {
        extend : 'Ext.data.Store',
        model    : 'Phonebook.model.Contact',
        sorters  : 'lastName',
        autoLoad : true,
        proxy: {
            type: 'ajax',
            url : 'contacts.json',
            reader : {
                type            : 'json',
                root            : 'contacts',
                successProperty : 'success',
                totalProperty   : 'total'
            }
        },
    });
    Model :
    Code:
    Ext.define('Phonebook.model.Contact', {
        extend : 'Ext.data.Model',
        fields : [
            { name : 'id',      type : 'int' },
            { name : 'firstName',    type : 'string' },
            { name : 'lastName',    type : 'string' },
            { name : 'email',   type : 'string' },
            { name : 'tel', type : 'string' }
        ],
    });
    JSON file :
    Code:
    {
        "success"    : true,
        "total"      : 2,
        "contacts"   : [
            {
                "id"        : 1,
                "firstName" : "john",
                "lastName"  : "nash",
                "email"     : "j_nash@yahoo.com",
                "tel"       : "09124624557"
            },
            {
                "id"        : 2,
                "firstName" : "tom",
                "lastName"  : "diaz",
                "email"     : "t_diaz@yahoo.com",
                "tel"       : "09124624667"
            }
        ]
    }

  2. Quote Originally Posted by h_ghare View Post
    thanks mitchellsimoens,

    I am running on local, not on web server, do you think it is the problem cause???
    Very much so

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,782
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Using your code, the store is being populated for me.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Tehran
    Posts
    10
    Vote Rating
    0
    h_ghare is on a distinguished road

      0  

    Default


    thanks mitchellsimoens,

    I am running on local, not on web server, do you think it is the problem cause???

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,782
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by h_ghare View Post
    thanks mitchellsimoens,

    I am running on local, not on web server, do you think it is the problem cause???
    Very much so
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User
    Join Date
    Nov 2011
    Location
    Tehran
    Posts
    10
    Vote Rating
    0
    h_ghare is on a distinguished road

      0  

    Default


    mitchellsimoens, it seems that you are a hero in sencha forum.

    thanks very much

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