SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface ISort

    A stateful sort object that binds criteria to a specific index within an ITable.

    • Criteria (ISort.Criteria) – how to sort a single index (direction, collator, value vs color, etc.).
    • Options (ISort.Options) – a single sort specification: index plus criteria.
    • Levels (ISort.RangeOptions.levels) – an ordered list of options (primary → secondary → ...).
    interface ISort {
        isISort: true;
        apply(): void;
        delete(): void;
        getCriteria(): Readonly<Criteria> | null;
        getIndex(): number;
        getLevel(): number;
        getRange(): ICellRange;
        setCriteria(criteria: Criteria | null, append?: boolean): void;
        sort(reverse?: boolean): void;
    }
    Index
    isISort: true

    For runtime type checking.

    • Reapplies the sort.

      Returns void

    • Clears the sort criteria and removes from sort levels.

      Returns void

    • Gets the sort criteria.

      Returns Readonly<Criteria> | null

      The sort criteria or null if none is set.

    • The field index within the sort range or table.

      Returns number

      • For row-major sorts, this is a column index.
      • For column-major sorts, this is a row index.
      • It is always relative to the sorted region, not the sheet.
    • The level of the sort (0-based).

      Returns number

      This is based on the order of the sort fields. If the sort has no criteria the level will be -1.

    • Sets the sort criteria.

      Parameters

      • criteria: Criteria | null

        The sort criteria to set, or null to clear this field.

      • Optionalappend: boolean

        If true, keeps existing sort levels and adds/updates this field. If false or omitted, this field becomes the only sort field.

      Returns void

    • Sorts this index using its current criteria.

      Parameters

      • Optionalreverse: boolean

        If provided, temporarily overrides the reverse flag for this sort.

      Returns void

      • This method mutates the owning table/range by reordering rows/columns.
      • If reverse is undefined, the effective direction is: criteria.reverse ?? rangeDefaults.reverse ?? false.