1. #1
    Ext User merry andrew's Avatar
    Join Date
    Jul 2010
    Location
    Ellensburg
    Posts
    25
    Vote Rating
    0
    merry andrew is on a distinguished road

      0  

    Default Ajax.request VS Store proxy

    Ajax.request VS Store proxy


    I'm trying to understand how the Ajax.request is represented in a Store's proxy configuration because I'd like to use a Store to handle the data retrieval. Here is the Ext.Ajax.request pulling successfully pulling data from a server:

    Code:
    var makeAjaxRequest = function() {
                Ext.Ajax.request({
                    url: 'http://myurl/Data.svc',
    				method: 'GET',
    				headers: {
    					'Accept': 'application/json'
    					//'Content-Type': '*/*', <-- toggle if errors appear
    				},
                    success: function(response, opts) {
    					var data = Ext.decode(response.responseText);
                        template.overwrite(panel.body, data.d);
    					Ext.getCmp('status').setTitle('json response loaded!');
                    }
                })
            };
    Here is how I'm trying to work with just a Store:

    Code:
    var personStore = new Ext.data.JsonStore({ // store to autoload Persons data... for list gen testing
    			model: 'Person',
    				
    			proxy: {
    				type: 'ajax',
    				url: 'http://myurl/Data.svc',
    				method: 'GET',
    					headers: {
    						'Accept': 'application/json'
    					}
    				reader: {
    					type: 'json',
    					root: 'results',
    					idProperty: 'juvis',							
    				}
    			},
    			
    			autoLoad: true,
    			
    			fields: [		
    				{name: 'firstName', mapping: 'FirstName'},
    				... etc
                            ]
    		});
    Where am I going wrong? Any advice would be greatly appreciated.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,835
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Currently there's nothing built in to let you customize the headers like that, we'll look into adding it in future.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Similar Threads

  1. Ajax Proxy/Json Store
    By eldiego34 in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 19 Aug 2010, 4:59 AM
  2. add a param to all Ext.Ajax.request (tree, store, normal Ajax.request)
    By aj3423 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 26 Jan 2010, 9:18 AM
  3. autoLoad vs Ext.Ajax.request... loadScripts not working w/Ajax.request
    By zhegwood in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 6 Aug 2009, 3:28 PM

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