Hybrid View

  1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Bangalore
    Posts
    95
    Vote Rating
    1
    Rameshlamani is on a distinguished road

      0  

    Default Expected ':' in sencha touch2

    Expected ':' in sencha touch2


    Hi i am new to sencha touch2. i called web service as below but it is giving error like expected ':' please tel me what is d pbm. how to fix it.

    here is my code:

    Ext.define("path", {
    extend: 'Ext.form.Panel',
    requires: [
    'Ext.data.JsonP'
    ],
    xtype: 'companyprofilepage',
    id: 'companyprofile',
    config: { scrollable: true,
    items: [{
    xtype: 'list',
    Ext.data.JsonP.request({ //hi Here i am getting error like expected ':'
    url: 'http://free.worldweatheronline.com/feed/weather.ashx',
    callbackKey: 'callback',
    params: {
    key: '23f6a0ab24185952101705',
    q: '94301', // Palo Alto
    format: 'json',
    num_of_days: 5
    },
    callback: function (success, request) {
    var weather = request.data.weather;
    if (weather) {
    panel.updateHtml(tpl.applyTemplate(weather));
    }
    else {
    alert('There was an error retrieving the weather.');
    }
    }
    }]
    }
    });

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    103
    Vote Rating
    10
    pepperseb is on a distinguished road

      0  

    Default


    You have to share the logic: You should use a store with a proxy to call the webservice and only use the view to display the information.

    Code:
    Ext.define("path", {
    extend: 'Ext.form.Panel',
    requires: [
    'Ext.data.JsonP'
    ],
    xtype: 'companyprofilepage',
    id: 'companyprofile',
    config: { scrollable: true,
    items: [{
    xtype: 'list',
    store: 'weather'
    
    }]
    }
    });
    You can find how to create and use a store and proxy in the documentation
    http://docs.sencha.com/touch/2-0/#!/api/Ext.data.proxy.JsonP

    T
    here's also a great example, which is similar to what you want, in the Kitchen Sink example, Data > JSONP
    http://docs.sencha.com/touch/2-0/#!/...e/kitchen-sink

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,780
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Your response probably isn't valid JSONP. You can check the response with http://www.jsonplint.com/ but most likely you didn't surround the JSON with the callback function.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 2

Tags for this Thread

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