-
31 Jan 2008 10:44 AM #1
Problem getting remoteSort: true action with column sort
Problem getting remoteSort: true action with column sort
I have a JsonStore with a remoteSort attribute of 'true'. According to the 2.0 documentation:
In my Grid, paging appears to be working fine, unless someone has clicked a column header for sorting first. Rather than going to the server for a fresh data set meeting the sort criteria, it is sorting from the current record cache, then goes to the server on each additional request. This is a major issue, as it throws off the end data being given back to the user (records that may appear twice, depending on which page they began on, etc.)True if sorting is to be handled by requesting the Proxy to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache in place (defaults to false).
If remote sorting is specified, then clicking on a column header causes the current page to be requested from the server
Any suggestions?--
Steve "Cutter" Blades
Adobe Community Professional - ColdFusion
Adobe Certified Professional - Advanced Macromedia ColdFusion MX 7 Developer
_____________________________
Blog: Cutter's Crossing
Co-Author "Learning Ext JS 3.2"
-
31 Jan 2008 11:03 AM #2
post a code of your search in server side, and a js os your grid .
-
31 Jan 2008 11:15 AM #3
JsonStore config
JsonStore config
I can't really post the server side, for a variety of reasons. It doesn't really matter, because the initial sort, from clicking on a column header, is being done on the local cache (I just don't know why). Paging from there always does the remote call, as it should. Here is an abbreviated config, with the columns removed, to show the other base config:
Code:var ds = new Ext.data.JsonStore({ url:'/RemoteProxy.cfc', baseParams: { // some post params }, totalProperty: 'totalCount', root: 'root', fields: [{ // several columns identified by name/mapping pairs }], remoteSort: true, listeners:{ 'beforeload':{ fn:function(){ // some basic stuff here with baseParams }, scope:this } } });--
Steve "Cutter" Blades
Adobe Community Professional - ColdFusion
Adobe Certified Professional - Advanced Macromedia ColdFusion MX 7 Developer
_____________________________
Blog: Cutter's Crossing
Co-Author "Learning Ext JS 3.2"
-
31 Jan 2008 1:36 PM #4
try something like this
PHP Code:var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'url'
}),
reader: new Ext.data.JsonReader({
root: 'dados',
totalProperty: 'total',
id: 'pri_cod',
fields: [
{name:'pri_cod', type:'string'},
{name:'pri_nome', type:'string'},
{name:'pri_data', type:'date',dateFormat:'Y-m-d'},
{name:'est_cod', type:'int'}]
}),
// turn on remote sorting
[B]remoteSort: true[/B]
});
-
31 Jan 2008 1:57 PM #5
Success
Success
Yeah, I already had that in the above script. I did finally get it, placing the remoteSort attribute option before my fields definition. I also removed the single quotes around the beforeload handler name. Suddenly I'm gold. Odd, but it works. Thanks for the assist though.
--
Steve "Cutter" Blades
Adobe Community Professional - ColdFusion
Adobe Certified Professional - Advanced Macromedia ColdFusion MX 7 Developer
_____________________________
Blog: Cutter's Crossing
Co-Author "Learning Ext JS 3.2"


Reply With Quote
gmail.com