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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:15:37+00:00 2026-05-22T14:15:37+00:00

I am new in sench-touch. I am trying to show JSON data using data

  • 0

I am new in sench-touch. I am trying to show JSON data using data Store.

Here is my code “gridView2.js” code:

Ext.setup({
    tabletStartupScreen: 'tablet_startup.png',
    phoneStartupScreen: 'phone_startup.png',
    icon: 'icon.png',
    glossOnIcon: false,

   onReady: function() {        

        Ext.regModel('Product', {
            fields: [
                {name: 'name',        type: 'string'},
                {name: 'description', type: 'string'},
                {name: 'price',       type: 'float'},
                {name: 'image_url',   type: 'string'},
                {name: 'in_stock',    type: 'boolean'}
            ]
        });

        Ext.regModel('car', {
            fields: [                               
                {name: 'manufacture',type: 'string'},
                {name: 'model',   type: 'string'},
                {name: 'price',    type: 'decimal'}

            ]
        });

        var productsList = new Ext.DataView({
            store: new Ext.data.Store({
                model: 'car',
                proxy: {
                    type: 'ajax',
                    url : 'cars.json',
                    reader: {
                        type: 'json',
                        root: 'data'
                    }
                }
            }),
            tpl: new Ext.XTemplate(
                '<tpl for=".">',
                    '<div>',
                        '<img src="{manufacture}" />',
                        '<div class="button">Buy</div>',
                    '</div>',
                '</tpl>'
            ),
            fullscreen: true,
            autoLoad : true
        });


    }//ends onReady   
});

my JSON file contains:

{"data":[{"created_at":null,"id":1,"manufacture":"tata","model":"indica","price":200000,"updated_at":null},{"created_at":null,"id":2,"manufacture":"suzuki","model":"waganor","price":400000,"updated_at":null},{"created_at":null,"id":3,"manufacture":"mahindra","model":"xylo","price":600000,"updated_at":null}],"results":3}

my html code is:

Login Screen 2

 <!-- Sencha Touch CSS -->
 <link rel="stylesheet" href="resources/css/sencha-touch.css" type="text/css">

 <!-- Custom CSS -->
  <!--<link rel="stylesheet" href="css/guide.css" type="text/css">-->


 <!-- Sencha Touch JS -->
 <script type="text/javascript" src="sencha-touch-debug.js"></script>
<script type="text/javascript" src="sencha-touch.js"></script>

 <!-- Application JS -->
 <!--  <script type="text/javascript" src="transaction.js"></script> -->
  <script type="text/javascript" src="gridView2.js"></script> 

My prblem is when I am executing html file it shows nothing.

  • 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-22T14:15:37+00:00Added an answer on May 22, 2026 at 2:15 pm

    Following code is correct and working:

    Ext.setup({
        tabletStartupScreen: 'tablet_startup.png',
        phoneStartupScreen: 'phone_startup.png',
        icon: 'icon.png',
        glossOnIcon: false,
    
       onReady: function() {        
    
            Ext.regModel('Product', {
                fields: [
                    {name: 'name',        type: 'string'},
                    {name: 'description', type: 'string'},
                    {name: 'price',       type: 'float'},
                    {name: 'image_url',   type: 'string'},
                    {name: 'in_stock',    type: 'boolean'}
                ]
            });
    
            Ext.regModel('car', {
                fields: [                               
                    {name: 'manufacture',type: 'string'},
                    {name: 'model',   type: 'string'},
                    {name: 'price',    type: 'decimal'}
    
                ]
            });
    
            var productsList = new Ext.DataView({
                store: new Ext.data.Store({
                    model: 'car',
                    proxy: {
                        type: 'ajax',
                        url : 'cars.json',
                        reader: {
                            type: 'json',
                            root: 'data'
                        }
                    },
                    autoLoad : true
                }),
                tpl: new Ext.XTemplate(
                    '<tpl for=".">',
                        '<div class="item">',
                            '<img src="{manufacture}" />',
                            '<div class="button">Buy</div>',
                        '</div>',
                    '</tpl>'
                ),
                itemSelector: "div.item",
                fullscreen: true
    
            });
       }
    });
    

    You forgot to add itemSelector for DataView and put auroLoad property out of store definition

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

Sidebar

Related Questions

New to sencha touch here. I've checked out quite a few tutorials online. I
I am trying to find a way in sencha touch store that when loading
I am trying to customize an Ext.form.Slider in Sencha Touch 1.1. This is my
I am currently playing with Sencha Touch, and I'm trying to get data from
I am trying to build a web app for Android device using Senahc Touch
I'm new to HTML5 and using sencha touch. Please anyone give me a full
I'm trying to use Sencha Touch 2 to load a local json file into
When using the [relatively new] MVC bits in Sencha Touch I find that 90%
I'll begin with the usual disclaimer: new to Sencha Touch/working with JSON, floundering in
I'm new to Sencha Touch and the Ext JS logic. Actually, I'm displaying a

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.