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 6788159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:27:06+00:00 2026-05-26T17:27:06+00:00

I am currently playing with Sencha Touch, and I’m trying to get data from

  • 0

I am currently playing with Sencha Touch, and I’m trying to get data from a drupal installation using JSON Views. I’ve looked at the Sencha API documentation, but can’t get it to work.

My Json response is the following:

{
  "spots" : [
    {
      "spot" : {
        "nid" : "10",
        "created" : "1288868246",
        "title" : "Almanarre",
        "type" : "spot",
        "city" : "Hyères",
        "country" : "fr",
        "latitude" : "43.083433",
        "longitude" : "6.148224"
      }
    },
    {
      "spot" : {
        "nid" : "11",
        "created" : "1288956341",
        "title" : "Lac de Neuchâtel",
        "type" : "spot",
        "city" : "Dakhla",
        "country" : "ma",
        "latitude" : "23.866295",
        "longitude" : "-15.738344"
      }
    },
    {
      "spot" : {
        "nid" : "12",
        "created" : "1288958572",
        "title" : "Zurich",
        "type" : "spot",
        "city" : "Zurich",
        "country" : "ch",
        "latitude" : "0.000000",
        "longitude" : "0.000000"
      }
    },
    {
      "spot" : {
        "nid" : "13",
        "created" : "1289302233",
        "title" : "Berne",
        "type" : "spot",
        "city" : "Berne",
        "country" : "ch",
        "latitude" : "46.947999",
        "longitude" : "7.448148"
      }
    },
    {
      "spot" : {
        "nid" : "14",
        "created" : "1290266721",
        "title" : "Dakhla",
        "type" : "spot",
        "city" : "Rio de Janeiro",
        "country" : "br",
        "latitude" : "-22.903539",
        "longitude" : "-43.209587"
      }
    },
    {
      "spot" : {
        "nid" : "15",
        "created" : "1299172773",
        "title" : "Paje",
        "type" : "spot",
        "city" : "Paje",
        "country" : "tz",
        "latitude" : "-6.265646",
        "longitude" : "39.535332"
      }
    }
  ]
}

And my Model/Store/List :

Ext.regModel( 'Spot', {
            idProperty: 'id',
            fields : [
                { name: 'id', type: 'int'},
                { name: 'date', type: 'date', dateFormat: 'c' },
                { name: 'title', type: 'string'},
                { name: 'type', type: 'string'},
                { name: 'country', type: 'string'},
                { name : 'city', type: 'string' },
                { name : 'lat', type: 'string' },
                { name: 'long', type: 'string'}
            ]
        }); // Model


        Ext.regStore('spotStore', {
            model: 'Spot',
            proxy: {
                type: 'ajax',
                url: '/api/spots/',
                reader: {
                    type: 'json',
                    root: 'spots'
                },
                autoload: true
            }
        });
ks.views.spotsList = new Ext.List({
            id: 'spotsList',
            store: 'spotStore',
            itemTpl: '<div class="list-item-title">{title}</div>' + '<div class="list-item-narrative">{country}</div>',
            onItemDisclosure: function(record){

            },
            listeners: {
                'render': function (thisComponent) {
                    thisComponent.getStore().load();
                }
            }
        });

The call is made, it creates the list with an accurate number of 6 items. But I can’t make the variables in the itemTpl show up…

Any ideas ?

Thanks a lot !

  • 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-26T17:27:07+00:00Added an answer on May 26, 2026 at 5:27 pm

    The problem is with the root variable you have mentioned while creating the store. I suggest some changes in the Json format
    ie

    {
        "spots": [
            {
                "nid": "10",
                "created": "1288868246",
                "title": "Almanarre",
                "type": "spot",
                "city": "Hyères",
                "country": "fr",
                "latitude": "43.083433",
                "longitude": "6.148224"
            },
            {
                "nid": "11",
                "created": "1288956341",
                "title": "Lac de Neuchâtel",
                "type": "spot",
                "city": "Dakhla",
                "country": "ma",
                "latitude": "23.866295",
                "longitude": "-15.738344"
            },
            {
                "nid": "12",
                "created": "1288958572",
                "title": "Zurich",
                "type": "spot",
                "city": "Zurich",
                "country": "ch",
                "latitude": "0.000000",
                "longitude": "0.000000"
            },
            {
                "nid": "13",
                "created": "1289302233",
                "title": "Berne",
                "type": "spot",
                "city": "Berne",
                "country": "ch",
                "latitude": "46.947999",
                "longitude": "7.448148"
            },
            {
                "nid": "14",
                "created": "1290266721",
                "title": "Dakhla",
                "type": "spot",
                "city": "Rio de Janeiro",
                "country": "br",
                "latitude": "-22.903539",
                "longitude": "-43.209587"
            },
            {
                "nid": "15",
                "created": "1299172773",
                "title": "Paje",
                "type": "spot",
                "city": "Paje",
                "country": "tz",
                "latitude": "-6.265646",
                "longitude": "39.535332"
            }
        ]
    }
    

    Hope it will help…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently playing a bit with couchdb. I'm trying to migrate some blog data
I'm currently playing with the Stack Overflow data dumps and am trying to construct
I am currently playing with Qt trying to set up a small particle system.
I'm currently playing with django to get acquainted with it. I want to build
I am currently playing around with VB.Net using Visual Studio 2010 (.Net 4.0) and
I'm currently playing around with java.nio , which I haven't been using for a
I'm currently playing with ExtJS 4 for my new project. I'm using MVC architecture
I'm currently playing with ARM assembly on Linux as a learning exercise. I'm using
I am currently playing around with the FCKEditor, and I am trying to replicate
I'm currently playing around with the pre and post build events in VS2010, trying

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.