[CLOSED] Manually Set Grid Header Sort Icon

  1. #1

    [CLOSED] Manually Set Grid Header Sort Icon

    How do I manually set the sort icon for a column on a grid on the server side.

    On the client side, I can do this:
    var colIndex = grid.getColumnModel().findColumnIndex(sortField);
    grid.getView().updateSortIcon(colIndex, sortDirection);
    But I can't find any equivelent on the server side?
  2. #2

    RE: [CLOSED] Manually Set Grid Header Sort Icon

    Hi,

    We have no server sode*equivalents because it is client side actions (plus*updateSortIcon is not public function, it is for internal usage*)


    You can register these scripts with AddScript method on server side




  3. #3

    RE: [CLOSED] Manually Set Grid Header Sort Icon



    Vladimir;

    So if updateSortIcon is not the way to do this, what is?

    Again, I'm pre-sorting the data before I give it to the store. In general, I do not want the store to re-sort it, that would a waste of cpu. Although there is one case where that would be desirable (don't ask why, its an LDAP thing).

  4. #4

    RE: [CLOSED] Manually Set Grid Header Sort Icon

    Hi Randy,

    I didn't tell that updateSortIcon is not the way to do this.
    Just single way to perform it on server side (initiate performing because it will perform on client side) is register script

    GridPanel1.AddScript("var colIndex = {0}.getColumnModel().findColumnIndex(sortField);{0}.getView().updateSortIcon(colIndex, sortDirection);", GridPanel1.ClientID);
  5. #5

    RE: [CLOSED] Manually Set Grid Header Sort Icon

    How about setting the SortInfo property on the Store? Using markup it would look like the following.

    Example

    <ext:Store ID="Store1" runat="server">
        <Reader>
            <ext:ArrayReader>
                <Fields>
                    <ext:RecordField Name="company" />
                </Fields>
            </ext:ArrayReader>
        </Reader>
        <SortInfo Field="company" Direction="DESC" />
    </ext:Store>
    Hope this helps.

    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Icon in Grid Column header
    By FAS in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 14, 2012, 1:30 PM
  2. Replies: 0
    Last Post: Feb 23, 2012, 5:05 AM
  3. Replies: 4
    Last Post: Jul 25, 2011, 4:57 PM
  4. [CLOSED] [1.0] Possible to Add Icon to Grid Column Header?
    By bsnezw in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 14, 2010, 2:34 PM
  5. [CLOSED] Remove sort Asc/Desc from grid header context menu
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 29, 2009, 2:59 PM

Posting Permissions