1. #11
    Ext User
    Join Date
    Oct 2007
    Posts
    15
    Vote Rating
    0
    Horace is on a distinguished road

      0  

    Default


    I was referring to the body of the actual http response, but I'd guess that's rather irrelevant.
    At any rate, my data looks fine to me.

  2. #12
    Ext User
    Join Date
    Oct 2007
    Posts
    15
    Vote Rating
    0
    Horace is on a distinguished road

      0  

    Default


    An interesting point, the grid handles a server-side sort fine. I click a column header to sort, the data comes back to the browser, and the grid refreshes.

    But alas, no paging.

  3. #13
    Ext User
    Join Date
    Oct 2007
    Posts
    15
    Vote Rating
    0
    Horace is on a distinguished road

      0  

    Default


    Here's my code (you'll see I changed very little from the example). Data loads, server-side sort works, new data is returned from the server when clicking a paging a button but the grid is not refreshed.

    Code:
    Ext.onReady(function(){
    
    	// create the Data Store
    	var ds = new Ext.data.Store({
    		// load using script tags for cross domain, if the data in on the same domain as
    		// this page, an HttpProxy would be better
    		proxy: new Ext.data.ScriptTagProxy({
    			url: 'http_getUsers.php'
    		}),
    
    		// create reader that reads the Topic records
    		reader: new Ext.data.JsonReader({
    			root: 'users',
    			totalProperty: 'totalCount',
    			id: 'login'
    		}, [
    			'login', 'first_name', 'last_name', 'last_login'
    		]),
    
    		// turn on remote sorting
    		remoteSort: true
    	});
    	ds.setDefaultSort('login', 'desc');
    
    	// dataIndex maps the column to the specific data field in
    	// the data store
    	var cm = new Ext.grid.ColumnModel([{
    		   id: 'topic', // id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })
    		   header: "Topic",
    		   dataIndex: 'login',
    		   width: 420
    		},{
    		   header: "Author",
    		   dataIndex: 'first_name',
    		   width: 100
    		},{
    		   header: "Replies",
    		   dataIndex: 'last_name',
    		   width: 70
    		},{
    		   id: 'last',
    		   header: "Last Post",
    		   dataIndex: 'last_login',
    		   width: 150
    		}]);
    
    	// by default columns are sortable
    	cm.defaultSortable = true;
    
    	var grid = new Ext.grid.GridPanel({
    		width:700,
    		height:500,
    		title:'ExtJS.com - Browse Forums',
    		store: ds,
    		cm: cm,
    		trackMouseOver:false,
    		sm: new Ext.grid.RowSelectionModel({selectRow:Ext.emptyFn}),
    		loadMask: true,
    		viewConfig: {
    			forceFit:true,
    			enableRowBody:true,
    			showPreview:true
    		},
    		bbar: new Ext.PagingToolbar({
    			pageSize: 25,
    			store: ds,
    			displayInfo: true,
    			displayMsg: 'Displaying topics {0} - {1} of {2}',
    			emptyMsg: "No topics to display",
    			items:[
    				'-', {
    				pressed: true,
    				enableToggle:true,
    				text: 'Show Preview',
    				cls: 'x-btn-text-icon details',
    				toggleHandler: toggleDetails
    			}]
    		})
    	});
    
    	// render it
    	grid.render(document.body);
    
    	// trigger the data store load
    	ds.load({params:{start:0, limit:25, forumId: 4}});
    
    	function toggleDetails(btn, pressed){
    		var view = grid.getView();
    		view.showPreview = pressed;
    		view.refresh();
    	}
    });
    and again, here's the data returned by the ScriptTagProxy call to "http_getUsers.php":

  4. #14
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    can you post your request data too please?

  5. #15
    Ext User
    Join Date
    Oct 2007
    Posts
    15
    Vote Rating
    0
    Horace is on a distinguished road

      0  

    Default


    Nevermind, it was the result of a bad condition inside of a for loop, which resulted in the users array starting with a comma.

    Yeah, I know... amateurs-ville. Thanks for your help.

  6. #16
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    glad u figured it out. we are not here to judge, just poke fun at. :P

  7. #17
    Ext User
    Join Date
    Apr 2008
    Posts
    2
    Vote Rating
    0
    gcpeters is on a distinguished road

      0  

    Default


    I see you figured yours out. I had a similar problem using the HttpProxy, all I had to do was include method:'GET' in the proxy config object. In trying to fix my problem I came on this thread so I figured it was a good place to post this fix.

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