1. #11
    Sencha User
    Join Date
    Nov 2010
    Posts
    38
    Vote Rating
    0
    elshae is on a distinguished road

      0  

    Default


    Thanks for your reply, but it didn't work for me...

    I 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"}},
    ....
    ....
    I also tried:
    Code:
    baseParams: {task: "LISTING", field: 'location', direction:  "ASC"},
    elshae

  2. #12
    Sencha User darthwes's Avatar
    Join Date
    Mar 2010
    Posts
    633
    Vote Rating
    -11
    darthwes can only hope to improve

      0  

    Default


    Code:
    baseParams: {
        task: "LISTING",
        sort: 'location',
        dir: 'ASC'
    },
    remoteSort: true,
    sortInfo: {
        field: 'location',
        direction: "ASC"
    },
    Wes

  3. #13
    Sencha User
    Join Date
    Nov 2010
    Posts
    38
    Vote Rating
    0
    elshae is on a distinguished road

      0  

    Default


    I really appreciate the help, but it's not taking effect

    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"}
              
        });
    Thank you,

    elshae

  4. #14
    Sencha User
    Join Date
    Nov 2010
    Posts
    38
    Vote Rating
    0
    elshae is on a distinguished road

      0  

    Default


    I still have not yet resolved this

  5. #15
    Sencha User johnathanhebert's Avatar
    Join Date
    Apr 2008
    Posts
    77
    Vote Rating
    0
    johnathanhebert is on a distinguished road

      0  

    Default


    I think the problem is on your server side... can you confirm that you are sorting the records on the server?

  6. #16
    Sencha User
    Join Date
    Nov 2010
    Posts
    38
    Vote Rating
    0
    elshae is on a distinguished road

      0  

    Default


    I have decided to just do it straight from the query...

    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);
    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...

    cheers,

    elshae

  7. #17
    Sencha User johnathanhebert's Avatar
    Join Date
    Apr 2008
    Posts
    77
    Vote Rating
    0
    johnathanhebert is on a distinguished road

      0  

    Default


    You are doing it the Ext way... when you set remoteSort:true, you told Ext that the server would do the sorting

  8. #18
    Sencha User
    Join Date
    Nov 2010
    Posts
    38
    Vote Rating
    0
    elshae is on a distinguished road

      0  

    Default


    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

  9. #19
    Sencha User johnathanhebert's Avatar
    Join Date
    Apr 2008
    Posts
    77
    Vote Rating
    0
    johnathanhebert is on a distinguished road

      0  

    Default


    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

  10. #20
    Sencha User
    Join Date
    Nov 2010
    Posts
    38
    Vote Rating
    0
    elshae is on a distinguished road

      0  

    Default


    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

  1. Replies: 2
    Last Post: 7 Nov 2010, 11:57 PM
  2. Replies: 2
    Last Post: 26 Apr 2010, 9:03 AM
  3. Replies: 7
    Last Post: 15 Dec 2008, 9:16 AM

Thread Participants: 2

Tags for this Thread

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