Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6954763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:38:53+00:00 2026-05-27T14:38:53+00:00

Hi guys I hope someone can help me with this I´m really stuck although

  • 0

Hi guys I hope someone can help me with this I´m really stuck although it´s some damned beginner question that has already been answered and I assure you I read all of the answer Posts but still can´t get it to work.

I´m using Sencha Touch 1.1.1 and try to get this Store loaded with nested JSON data. Here´s the code:

    Ext.regModel("UserData", {

        hasMany : [{
            name : "id",
            type : "integer",
        },{
            name : "username",
            type : "string",
        },{
            name : "password",
            type : "string",
        }]

    });

    var userdata = 
        {"users": [
                  {
                      "id": 16,
                      "username": "bla@bla.com",
                      "password": "bla",
                  }, {
                      "id": 17,
                      "username": "bla@bla.com",
                      "password": "bla",
                  }
                 ]
        };


    var myStore = new Ext.data.Store({

        model : 'UserData',
        data : userdata,
        proxy : {
            type : 'ajax',             

            reader : {
                type : 'json',
                root : 'users'      // not working          
            }
        }

    });

    var myList = new Ext.List ({

        fullscreen : true,
        store : myStore,
        grouped : false,
        itemTpl : '<div>{username}</div>'

    });

Returns Uncaught Type Error: Arguments list has wrong type. When I rewrite the JSON with an outer Array wrapper, it works, but with wrong root (not users) I definitly saw examples where this worked with the root:” value.

var userdata = 
    [ {"users": [
              {
                  "id": 16,
                  "username": "bla@bla.com",
                  "password": "bla",
              }, {
                  "id": 17,
                  "username": "bla@bla.com",
                  "password": "bla",
              }
             ]
    } ];

What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:38:54+00:00Added an answer on May 27, 2026 at 2:38 pm

    If I am not mistaken, in your “UserData” model, it should be fields instead of hasMany.

    And try putting your json data in a separate json file and locate the path in your store’s proxy.

    var myStore = new Ext.data.Store({
    model: 'UserData',
    autoLoad: true,
    proxy: {
        type: 'ajax',
        url: 'test.json',
        reader: {
            type: 'json',
            root: 'users'
        }
    }
    });
    

    I tested it and it’s working fine here. Here is my full code.

        Ext.regModel("UserData", {
    
        fields: [
                {name: 'id', type:'int'},
                {name: 'username', type:'string'},
                {name: 'password', type:'string'}
    
        ]
    });
    
    
    var myStore = new Ext.data.Store({
        model: 'UserData',
        autoLoad: true,
        proxy: {
            type: 'ajax',
            url: 'test.json',
            reader: {
                type: 'json',
                root: 'users'
            }
        }
    });
    
    
    var app = new Ext.Application({
        name: 'TestApp',
        useLoadMask: true,
        launch: function() {
    
    
            TestApp.views.listToolbar = new Ext.Toolbar({
                title: 'Foo Bar',
                layout: 'hbox'
            });
    
            TestApp.views.list = new Ext.List({
                id: 'list',
                store: myStore,
                emptyText: 'Nothing',
                itemTpl: '<div class="username">{username}</div>',
            });
    
            TestApp.views.container = new Ext.Panel({
                layout: 'fit',
                html: 'this is the container',
                dockedItems: [TestApp.views.listToolbar],
                items: [TestApp.views.list]
            });
    
            TestApp.views.viewport = new Ext.Panel({
                fullscreen: true,
                layout: 'card',
                cardAnimation: 'slide',
                items: [
                    TestApp.views.container
                ]
            });
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question that i hope you guys can help me with! This
I hope some of you guys can help me with this problem.... I have
I am stuck with a design problem that I hope you guys can help
I hope you guys can help me with this. The navigation, tabmenunav has 3
I'm really confused so I hope you guys can help me. I know how
I hope you guys can help me with this one. So, I have a
Ok guys, I hope someone here can help me. I got a bunch of
Well guys, this problem just baffles me. I hope someone can explain to me
I've run in to a problem I hope you guys can help me with.
First time stackoverflow user but occasional lurker, hope you guys can help me out.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.