Interface SortInfo

Hierarchy

  • SortInfo

Properties

isAscending?: boolean
sortCaseInsensitive?: boolean

To sort this column insensitive of case. Only set this to true for string data, if you set this to true for numeric or date data, the sort results will be incorrect.

Property

Default

false

See

https://www.reactdatagrid.com/examples?expample=Sort_Options

sortColumn?: string
sortCompareFunction?: ((a: unknown, b: unknown) => 0 | 1 | -1)

Type declaration

    • (a: unknown, b: unknown): 0 | 1 | -1
    • A callback function that gets called when sorting the data in the column.

      Property

      Default

      null

      Example

      amountSortCompareFunction(obj1, obj2) {
      const aWorkPhone = resolveExpression(a, "workPhone");
      const bWorkPhone = resolveExpression(b, "workPhone");
      const aExtension = aWorkPhone.split("x")[1];
      const bExtension = bWorkPhone.split("x")[1];
      return aExtension.localeCompare(bExtension);
      }

      See

      https://www.reactdatagrid.com/examples?expample=Sort_Options

      Parameters

      • a: unknown
      • b: unknown

      Returns 0 | 1 | -1

sortNumeric?: boolean

To sort this column numerically.

Property

Default

false

See

https://www.reactdatagrid.com/examples?expample=Sort_Options

Generated using TypeDoc