0
votes

I have followed a Sencha guide step-by-step but I don't seem to be getting a response from my server. I'm not getting any errors in the console so I'm a bit stumped. Any help would be amazing.

Here is the store config in my view

store: {
  fields: ['title', 'description', 'time', 'date', 'image', 'longdesc'],

  proxy: {
     type: 'jsonp',
     url: 'http://mydomain.co.uk/scheduledata.json',
     reader: {
         type: 'json',
         rootProperty: 'scheduleData' 
  }
}

},
itemTpl: '<div class="white-circle">{time}</div> <div class="list-title">{title}</div> <div class="list-desc">{description}</div><div class="arrow-right"></div>'

and the JSON file hosted on my server.

{
 "scheduleData" : [
{
  "title" : "Event One",
  "description" : "Meet and Greet",
  "time" : "10:45",
  "date" : "Friday",
  "image" : "./resources/imageone.jpg",
  "longdesc" : "This is a longer description"
},
{
  "title" : "Event Two",
  "description" : "Q and A",
  "time" : "11:00",
  "date" : "Friday",
  "image" : "./resources/imagetwo.jpg",
  "longdesc" : "This is a longer description still"
}
 ]
}

UPDATE: Here is the full JS file with config:

Ext.define('scheduleApp.view.Home', {
//extend: 'Ext.Panel',
//xtype: 'homepanel',

extend: 'Ext.navigation.View',
xtype: 'schedulepanel',
id: 'sched',


config: {
    navigationBar: {
            hidden: true
        },
        title: '<span class="logo"></span>',
        items: [
            {
                xtype: 'container',
                layout: 'vbox',
                items: [
                    {
                        xtype: 'container',
                        flex: 2,
                        items: [
                            {
                                xtype: 'container',
                                layout: {
                                    type: 'hbox'
                                },
                                items: [
                                    {
                                    html: '<img src="./resources/map.jpg" width="100%" height="100%"/>'
                                }
                                ]
                            }
                        ]
                    },
                    {
                        xtype: 'container',
                        flex: 5,
                        layout: {
                            type: 'fit'
                        },
                        items: [
                            {
                                xtype: 'list',
                                store: {
                                    type: 'tree',
                                    sorters: 'date',


                                                       fields: ['title', 'description', 'time', 'date', 'image', 'longdesc'],



                                                        proxy: {
                                                            type: 'jsonp',
                                                            url: 'http://www.mydomain.co.uk/scheduledata.json',
                                                            reader: {
                                                                type: 'json',
                                                                rootProperty: 'scheduleData'
                                                            }
                                                        }
                                                    },
                                                    itemTpl: '<div class="white-circle">{time}</div> <div class="list-title">{title}</div> <div class="list-desc">{description}</div><div class="arrow-right"></div>'

                            }
                        ]
                    }
                ]
            }
        ]
    }

});

1
Check the network page using Chrome/Firefox dev console. You should see request for your JSON file there.sha
can you post complete list code ?SachinGutte
@SachinG Sorry Sachin I'm confused. That was all of the list code other than the xtypeMrFirthy
@user1694888 yes.. i meant to say post the code with xtype and it's config details. Also as suggested in first comment look at Network tab in chrome to see if data is getting loaded correctly.SachinGutte
@SachinG I looked at network and the json file doesn't even seem to appear so there's an error there. Will update my question to contain the full code now.MrFirthy

1 Answers

0
votes

did you try to set the store to autoload: true?