Results 1 to 5 of 5

Thread: JSON load to DataView doesn't work

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    26
    Answers
    1
    Vote Rating
    1
      0  

    Default Answered: JSON load to DataView doesn't work

    Any mistakes in the following code? I've been trying again and again but my JSON load doesn't work...I just see "Loading..." for several seconds then just a blank screen. I've tried loading via AJAX too, but that doesn't show the "Loading..." screen. Thanks in advance for the assistance.

    Sample of my JSON data:

    Code:
    {"households":[{"HHName":"Jim Smith Household"}])
    Code:
    Ext.regModel('Household', {
        fields: [
            {name: 'HHName',    type: 'string'}
        ]
    });
    
    var store = Ext.create('Ext.data.Store', {
            model    : 'Household',
            proxy: {
                type: 'jsonp',
                url: 'get_households.php',
                reader: {
                    type    : 'json',
                    root: 'households'
                }
            },
            autoLoad: true
        });
    
    var list = Ext.create('Ext.DataView', {
            store: store,
            itemTpl: '<p>household name is {HHName} </p>'
        });

  2. You are using JsonP so is the response valid for JsonP?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •