-
11 Oct 2007 4:49 PM #11
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.
-
11 Oct 2007 4:58 PM #12
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.
-
11 Oct 2007 5:33 PM #13
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.
and again, here's the data returned by the ScriptTagProxy call to "http_getUsers.php":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(); } });
-
12 Oct 2007 3:23 AM #14Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
can you post your request data too please?

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
12 Oct 2007 6:29 AM #15
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.
-
15 Oct 2007 10:37 AM #16Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
glad u figured it out. we are not here to judge, just poke fun at. :P

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
30 Apr 2008 1:58 PM #17
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.


Reply With Quote