[]
        
(Showing Draft Content)

FlexGridStyle Class

FlexGridStyle Class

Implements a styling API for FlexGrid controls.

To style cells in a FlexGrid control, create an instance of the FlexGridStyle and pass the grid as a parameter to the constructor. For example:

import { FlexGrid } from '@mescius/wijmo.grid';
import { FlexGridStyle } from '@mescius/wijmo.grid.style';
let theGrid = new FlexGrid('#theGrid'); // create the grid
let flexGridStyle = new FlexGridStyle(theGrid); // create an object of FlexGridStyle

The FlexGridStyle class depends on the wijmo.grid module.

The example below shows how you can use FlexGridStyle to add/remove styles on FlexGrid control:

Example

Heirarchy

  • FlexGridStyle

Constructors

constructor

Methods

applyStyle

  • applyStyle(rng: CellRange, style: Partial<CSSStyleDeclaration>, panel?: GridPanel, inline?: boolean): void
  • Applies the specified style (inline or class-based) to a cell range

    Parameters

    • rng: CellRange

      CellRange to apply the style to

    • style: Partial<CSSStyleDeclaration>

      css style object to apply to the cells

    • Optional panel: GridPanel

      The GridPanel the CellRange belongs to

    • Optional inline: boolean

      whether to add style as inline or create a new class

    Returns void

clearAllStyles

  • Removes all applied styles from the entire grid or from the specified cell range.

    Parameters

    Returns void

removeStyle

  • removeStyle(rng: CellRange, style: Partial<CSSStyleDeclaration>, panel?: GridPanel): void
  • Removes a specific style from a cell range.

    Parameters

    Returns void

toggleClass

  • toggleClass(rng: CellRange, className: string, panel?: GridPanel, addOrRemove?: boolean): void
  • Toggles the specified CSS classname on the provided cell range

    Parameters

    • rng: CellRange

      CellRange to apply the style to

    • className: string

      css ClassName to apply on provided CellRange

    • Optional panel: GridPanel

      The GridPanel the CellRange belongs to

    • Optional addOrRemove: boolean

      whether to add class or remove class, skipping this parameter toggle the provided class

    Returns void