State component allows saving and restoring the state of the grid features.

IgcGridStateComponent

new IgcGridStateComponent(args: any[]): IgcGridStateComponent

Returns IgcGridStateComponent

The tagName read-only property of the Element interface returns the tag name of the element on which it's called.

MDN Reference

tagName: string

Inherited from: EventEmitterMixin<IgcGridStateComponentEventMap, Constructor<IgcGridStateBaseDirective>>(IgcGridStateBaseDirective)

get options(): IgcGridStateOptions

Returns IgcGridStateOptions

An object with options determining if a certain feature state should be saved.

set options(value: IgcGridStateOptions): void

Parameters

Returns void

Inherited from: EventEmitterMixin<IgcGridStateComponentEventMap, Constructor<IgcGridStateBaseDirective>>(IgcGridStateBaseDirective)

addEventListener(type: K, listener: object, options: boolean | AddEventListenerOptions): void

Parameters

  • type: K
  • listener: object
  • options: boolean | AddEventListenerOptions

Returns void

Restores grid features' state based on the IGridStateInfo object passed as an argument.

applyState(state: IgcGridStateInfo, features: string[]): void

Parameters

Returns void

Restores grid features' state based on the serialized IGridState object passed as an argument.

applyStateFromString(state: string, features: string[]): void

Parameters

  • state: string

    string to restore state from.

  • features: string[]

Returns void

Gets the state of a feature or states of all grid features, unless a certain feature is disabled through the options property.

getState(features: string[]): IgcGridStateInfo

Parameters

  • features: string[]

Returns IgcGridStateInfo

Gets the state of a feature or states of all grid features, unless a certain feature is disabled through the options property.

getStateAsString(features: string[]): string

Parameters

  • features: string[]

Returns string

Inherited from: EventEmitterMixin<IgcGridStateComponentEventMap, Constructor<IgcGridStateBaseDirective>>(IgcGridStateBaseDirective)

removeEventListener(type: K, listener: object, options: boolean | EventListenerOptions): void

Parameters

  • type: K
  • listener: object
  • options: boolean | EventListenerOptions

Returns void

register(): void

Returns void

Event emitted when set state is called with a string. Returns the parsed state object so that it can be further modified before applying to the grid.

stateParsed: CustomEvent<IgcGridStateInfo>