-
10 Feb 2011 12:53 PM #11
Thanks for your reply, but it didn't work for me...
I tried:
I also tried:Code:placeNamesDataStore = new Ext.data.Store({ id: 'placeNamesDataStore', proxy: new Ext.data.HttpProxy({ url: 'tibetTestAdmin.php', // File to connect to method: 'POST' }), baseParams: {task: "LISTING", sortInfo:{field: 'location', direction: "ASC"}}, .... ....
elshaeCode:baseParams: {task: "LISTING", field: 'location', direction: "ASC"},
-
10 Feb 2011 4:26 PM #12
Code:baseParams: { task: "LISTING", sort: 'location', dir: 'ASC' }, remoteSort: true, sortInfo: { field: 'location', direction: "ASC" },
Wes
-
11 Feb 2011 7:04 AM #13
I really appreciate the help, but it's not taking effect

Thank you,Code:placeNamesDataStore = new Ext.data.Store({ id: 'placeNamesDataStore', proxy: new Ext.data.HttpProxy({ url: 'tibetTestAdmin.php', // File to connect to method: 'POST' }), baseParams: {task: "LISTING", sort: 'location', dir: 'ASC'}, // this parameter asks for listing reader: new Ext.data.JsonReader({ // we tell the datastore where to get data from root: 'results', totalProperty: 'total', idProperty: 'place_names_id', fields: [ {name: 'location', type: 'int', mapping: 'location'}, {name: 'name', type: 'string', mapping: 'name'}, {name: 'language_id', type: 'int', mapping: 'language_id'}, {name: 'language', type: 'string', mapping: 'language'}, {name: 'valid_name', type: 'string', mapping: 'valid_name'}, {name: 'transliteration', type: 'string', mapping: 'transliteration'}, {name: 'english_translation', type: 'string', mapping: 'english_translation'}, {name: 'type', type: 'int', mapping: 'type'}, {name: 'date_created', type: 'string', mapping: 'date_created'}, {name: 'date_modified', type: 'string', mapping: 'date_modified'}, {name: 'status', type: 'string', mapping: 'status'}, {name: 'place_group', type: 'int', mapping: 'place_group'}, {name: 'located_true', type: 'string', mapping: 'located_true'}, {name: 'place_names_id', type: 'int', mapping: 'place_names_id'}, {name: 'mslink', type: 'int', mapping: 'mslink'}, {name: 'source', type: 'int', mapping: 'source'}, {name: 'place_location_id', type: 'int', mapping: 'place_location_id'}, {name: 'lat', type: 'float', mapping: 'lat'}, {name: 'long', type: 'float', mapping: 'long'}, {name: 'feature_code', type: 'string', mapping: 'feature_code'}, {name: 'county', type: 'int', mapping: 'county'}, {name: 'prefecture', type: 'int', mapping: 'prefecture'}, {name: 'valid_location', type: 'string', mapping: 'valid_location'}, {name: 'category', type: 'string', mapping: 'category'}, {name: 'category_id', type: 'int', mapping: 'category_id'} ]}), remoteSort: true, sortInfo:{field: 'location', direction: "ASC"} });
elshae
-
15 Feb 2011 9:08 AM #14
-
15 Feb 2011 10:37 AM #15
I think the problem is on your server side... can you confirm that you are sorting the records on the server?
-
15 Feb 2011 11:06 AM #16
I have decided to just do it straight from the query...
Thanks everyone for pointing out to me to the server side, I know I'm not doing it the 'Ext' way, but I am satisfied with this...Code:$query = "select * from (select * .......) as foo order by someField ASC "; // Add this for the paging bar: $start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']); $end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']); $limit = $query." LIMIT ".$end." OFFSET ".$start; $place_name_result = @pg_query($DBConnect, $limit);
cheers,
elshae
-
15 Feb 2011 11:08 AM #17
You are doing it the Ext way... when you set remoteSort:true, you told Ext that the server would do the sorting
-
15 Feb 2011 11:18 AM #18
interesting...I just tried remoteSort: false. It kinda works....What it does is sort the records of that page? So it seems that the paging happens first and then the sort and hence the undesirable results for me. When I tell the query to sort it, I can tell it before the paging? Is my understanding correct?
Thanks for your kind and continued help
elshae
-
15 Feb 2011 11:21 AM #19
Yes, your understanding is correct. Since the browser and Ext only have access to the records loaded in browser memory, they obviously cant be sorted against the records that are not loaded... that is exactly why there is a remoteSort config option, so that your server can do the sorting for all pages first on the server side, and then send back one page of those sorted results to the browser.
In your query, right after the "order by" field, you could use the passed "sort" request parameter to sort by whatever field was sent by the paging toolbar (and thus, the column header was clicked by the user or whatever)Johnathan Hebert
-
15 Feb 2011 11:30 AM #20
Makes perfect sense to me now. Really, thank you so much!
I hope this post will help others on their journey..
cheers,
elshae
Similar Threads
-
[FIXED-448] Documentation Example for Observable's 'listen' config is wrong
By jhummel in forum Sencha Touch 1.x: BugsReplies: 2Last Post: 7 Nov 2010, 11:57 PM -
[FIXED-848] GroupingStore sort have a bug when not set the sortInfo of config
By skzr.org in forum Ext 3.x: BugsReplies: 2Last Post: 26 Apr 2010, 9:03 AM -
[2.0b1][SOLVED] Panel config: assigning Toolbar config to the 'tbar' option
By kx in forum Ext 2.x: BugsReplies: 7Last Post: 15 Dec 2008, 9:16 AM


Reply With Quote