1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default add json to store

    add json to store


    hi all,

    i have a json file on another server and do the call in json p but then it does not load into the store and then into my list

    Code:
    
    var store;
    Ext.setup({
    	onReady : function() {
    	
    Ext.define('User', {
        extend: 'Ext.data.Model',
         fields: [
    				{name: 'DayNumber', type: 'int'},
    				{name: 'PeriodNumber', type: 'string'},
    				{name: 'PeriodNumberSeq', type: 'string'},
    				{name: 'DefinitionPeriodNumber', type: 'string'},
    				{name: 'DefinitionTimeFrom', type: 'string'},
    				{name: 'DefinitionTimeTo', type: 'string'},
    				{name: 'ClassCode', type: 'string'},
    				{name: 'ClassDescription', type: 'string'},
    				{name: 'StaffID', type: 'string'},
    				{name: 'Room', type: 'string'},
        ]
    });
    
    
    
    
    var store = Ext.create('Ext.data.Store', {
        model: 'User',
    	autoLoad:true,
        proxy: {
            type: 'jsonp',
            url : 'https://intranet.trinity.vic.edu.au/timetable/getTimetable.asp?synID=300068&room=0&year=2011&term=4&day=8&callType=student'
        }
    });
    
    
    listPanel = new Ext.List({
    				store: store,
    				id:'todaypanel',
    				itemSelector:'item',
    				itemTpl:  '{ClassDescription}  <div id="teacher">{Room}</div>',
    		});
    			
    
    
    			panel = new Ext.Panel ({
    				fullscreen: true,
    				layout: 'card',
    				cardSwitchAnimation: 'slide',
    				items:[listPanel]
    			});
    		}
    });
    Matt

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,755
    Vote Rating
    828
    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


    What is the response? Is it a plain JSON string or does it have the callback method like this:

    Code:
    someCallback({.....})
    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.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default


    The Json does not have the call back. I don't have access to the server side is there a way to use jsonp without the callback or can I get the file then put it in the function?

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,755
    Vote Rating
    828
    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


    It has to have the callback function. What it does is creates a script tag and loads the JSON that way but it has to be executed within that script tag... this is why there is a 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.

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default


    Hmm is there another way to get the data? Into the list ?

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,755
    Vote Rating
    828
    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


    Quote Originally Posted by borden0108 View Post
    Hmm is there another way to get the data? Into the list ?
    Without a callback, no. It's the browser security that is stopping cross domain and ST1 doesn't have CORS support.
    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.

  7. #7
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default


    Could I get the data in in st2?

  8. #8
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,755
    Vote Rating
    828
    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


    Quote Originally Posted by borden0108 View Post
    Could I get the data in in st2?
    Ext JS 4's Ext.Ajax just got CORS support so it will probably be making it's way to ST2
    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.

  9. #9
    Sencha User
    Join Date
    Jun 2011
    Posts
    47
    Vote Rating
    0
    borden0108 is on a distinguished road

      0  

    Default


    I've heard that phone gap has CROS domain support through Ajax ?

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