1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    26
    Vote Rating
    1
    MrBeef is on a distinguished road

      0  

    Default JSON & DataView

    JSON & DataView


    I've tried many different examples, but I can't seem to get this right. I want to load an Ext.DataView from a PHP file that prints JSON.

    Here's an example of the JSON output:
    Code:
    {"households":[[{"HHName":"Jim Smith Household"}]]}
    Here's my model:
    Code:
        Ext.regModel('household', {
            fields: [{name: 'HHName', type: 'string'}]
        });
    and here's my DataView that I display in a TabPanel later...I'd appreciate any help with getting this working. Thanks!

    Code:
    var list = new Ext.DataView({
            store: new Ext.data.Store({
                model: 'household',
                proxy: {
                    type: 'ajax',
                    url: 'http://mywebsite.com/get_households.php',
                    reader: {
                        type: 'json',
                        root: 'households'
                    }
                }
            }),
            tpl: new Ext.XTemplate(
            '<tpl for=".">',
                '<div>',
                    '{HHName}',
                '</div>',
            '</tpl>'
        )
    });

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    18
    Vote Rating
    0
    amussini@gmail.com is on a distinguished road

      0  

    Default


    If your call is cross-domain, you should use jsonp, not ajax...

    Code:
    proxy: {
                    type: 'ajax',
                    url: 'http://mywebsite.com/get_households.php',
    
    
    proxy: {
                    type: 'jsonp',
                    url: 'http://mywebsite.com/get_households.php',

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi