Results 1 to 3 of 3

Thread: Grid: Post column name (not just id) in remote sort

  1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    6
    Vote Rating
    0
      0  

    Default Grid: Post column name (not just id) in remote sort

    In a grid, if you're doing remote paging and sorting, the POSTs only contain the column ID of the sortColumn. Here's how you can add the column name to the POST parameters (until grid 2.0 comes out which sounds like it'll have better column name support):

    Code:
    dataModel.createParams_original = dataModel.createParams;
    dataModel.createParams = function(pageNum, sortColumn, sortDir){
        params = dataModel.createParams_original(pageNum, sortColumn, sortDir);
        params['sortColumnName'] = dataModel.schema.fields[sortColumn];
        return params;
    };

  2. #2
    Ext Premium Member BernardChhun's Avatar
    Join Date
    Mar 2007
    Location
    Quebec, Canada
    Posts
    831
    Vote Rating
    2
      0  

    Default

    this works really well. thanks

  3. #3
    Ext JS Premium Member prophet's Avatar
    Join Date
    Mar 2007
    Location
    Greenwich, CT
    Posts
    189
    Vote Rating
    0
      0  

    Default

    I made this work with the XMLDataModel by changing :
    Code:
    params['sortColumnName'] = dataModel.schema.fields[sortColumn];
    To this:
    Code:
    params['sortColumnName'] = dataModel.getFieldName(sortColumn);
    It should also be noted that I'm using the yui-ext.0.40-alpha release.

Similar Threads

  1. Send sort column number in paged grid in Ext 1.0
    By JeffHowden in forum Community Discussion
    Replies: 3
    Last Post: 2 Jun 2008, 11:16 AM
  2. column sort makes ajax call for each time grid was recreated
    By lemontree in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 4 Jul 2007, 2:14 AM
  3. Grid: smart remote vs local sort
    By brondsem in forum Community Discussion
    Replies: 0
    Last Post: 26 Jan 2007, 7:19 AM
  4. grid sort marks all rows by the first column
    By lsmith in forum Ext 1.x: Help & Discussion
    Replies: 8
    Last Post: 22 Nov 2006, 9:13 AM
  5. Grid Sort for formatted date column in FF vs IE6
    By mrim in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 31 Oct 2006, 8:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •