News in versions: FastGrid 1.0, TreeGrid 17.0
FastGrid FastSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Development
services
References References Contacts
TreeGrid Gantt chart SpreadSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Contacts

2. Sorting columns

Sorting columns according to the values in selected rows

  • Setting sorting


    Column sorting must be permitted by setting 2. bit of Cfg

    Sorting

    .
    Column sorting can be set per column part as list of row ids in

    Sort

    attribute.
    To sort descending, add "-" before the row id, e.g. Sort:"A,-B".
    To assign an object to column part that already defined columns in array use the part id with "_" suffix, e.g. Cols: [...], Cols_Cfg: { Sort:"C,D" }
  • Changing sorting


    Sorting can be changed by click to column that has set

    SortIcons

    attribute. By default they are columns D:

    Header

    and

    Index

    .
    The way how the clicked row is added to sorting is controlled by Cfg

    SortType

    .
    The sorting can be cleared by clicking to Tool cell D:

    ClearSort

    or

    Sort

    .
  • Sorting settings


    Some of the global sorting setting can be changed by users in popup menu for Tool cell D:

    Sort

    .
    When comparing values for sorting it is possible to ignore case (Cfg

    SortCaseSensitive

    , row

    CaseSensitive

    ), diacritics (Cfg

    SortLocaleCompare

    , row

    LocaleCompare

    ), some characters (usually spaces) (Cfg

    SortWhiteChars

    , row

    WhiteChars

    ), etc.
    It is possible to sort values as strings or numbers / dates / ranges using row

    NumberSort

    attribute.
    List values are sorted by keys or index by default, to sort by the List values set row

    SortList

    attribute.
    To change the way the cell values are compared, set cell attribute

    SortValue

    to use this value instead of the cell value for comparing.
  • Sorting restrictions


    To not sort the column and fix it on left or right, set column

    SortFix

    attribute.
    To not sort column children, set parent column

    NoSort

    .