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

    Interface IColumn

    Returns a column for the table.

    interface IColumn {
        isIColumn: true;
        delete(options?: ITransaction.OperationOptions): void;
        getCalculatedFormula(): string | null;
        getFilter(): IFilter | null;
        getId(): string;
        getIndex(): number;
        getName(): string;
        getRange(options?: ICellRange.GetRangeOptions): ICellRange;
        getSort(): ISort | null;
        getTable(): ITable;
        getTotalsRowFormula(): string | number | null;
        getTotalsRowLabel(): string | null;
        isHiddenButton(): boolean;
        setHiddenButton(hidden: boolean): this;
        setName(name: string): this;
        setTotalsRowFormula(formula: string | number | undefined): this;
        setTotalsRowLabel(label: string): this;
        toJSON(): ColumnJSON | null;
    }
    Index
    isIColumn: true

    For runtime type checking.

    • Removes the column from the table.

      Parameters

      Returns void

      This will cause the columns to shift left and their indexes to change. Any associated filters/sorts will also be removed.

    • Returns the formula this column calculates its rows with.

      Returns string | null

      The formula without its leading =, as it reads in the column's first body row, or null if this is not a calculated column.

      A column becomes calculated when a formula is entered into one of its cells and the rest of the column is empty: the formula is filled down the column, and every row added to the table afterwards is given it too. Entering a different formula into a calculated column replaces it for the whole column, unless the column already holds a cell that differs.

      sheet.getRange('D2').setFormula('=[@Price]*[@Qty]');
      // once the column has filled
      table.getColumnByName('Total').getCalculatedFormula(); // '[@Price]*[@Qty]'
    • Returns the filter for this column.

      Returns IFilter | null

    • The unique id of the column.

      Returns string

      This will not change during the lifetime of the column.

    • The index of the column within the table.

      Returns number

    • A string representing the unique caption of the table column. This is what shall be displayed in the header row in the UI, and is referenced through functions. This name shall be unique per table.

      Returns string

    • Returns the sort field for this column.

      Returns ISort | null

    • Returns the table this column belongs to.

      Returns ITable

    • Returns what this column totals.

      Returns string | number | null

      A SUBTOTAL function number when the column is totaled by one over itself, the formula without its leading = for anything else, or null if there is none.

      While the totals row is shown this is what its cell holds, so a formula typed into the cell is returned here, and =SUBTOTAL(109,[Column]) typed into it returns 109.

    • Returns the text shown in the totals row for this column.

      Returns string | null

      The label or null if there is none.

      While the totals row is shown this is what its cell holds, so text typed into the cell is the label.

    • Returns whether the filter/sort button for this column is hidden.

      Returns boolean

    • Sets whether the filter/sort button for this column is hidden.

      Parameters

      • hidden: boolean

      Returns this

    • Sets the name of the column.

      Parameters

      • name: string

      Returns this

    • Sets what this column totals.

      Parameters

      • formula: string | number | undefined

        A SUBTOTAL function number (101 to 110; 109 is sum, 101 average, 103 count), a formula with or without the leading =, or undefined for none. A function number totals this column: 109 is =SUBTOTAL(109,[Column]).

      Returns this

      A totals cell shows a label or a formula, never both: setting a formula removes the column's totals label. While the totals row is hidden the formula is kept, and shown with the row.

      table.setShowTotals(true);
      table.getColumnByName('Amount').setTotalsRowFormula(109);
      table.getColumnByName('Price').setTotalsRowFormula('=MAX([Price])-MIN([Price])');
    • Sets the text shown in the totals row for this column.

      Parameters

      • label: string

        The text, or an empty string for none.

      Returns this

      A totals cell shows a label or a formula, never both: setting a label removes the column's totals formula. While the totals row is hidden the label is kept, and shown with the row.

    • Returns ColumnJSON | null

      The current state as a JSON object or null if not serializable.