Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataSource<T>

data modules

namespace

cheetahGrid.data

memberof

cheetahGrid

Type parameters

  • T

Hierarchy

Implements

Index

Constructors

constructor

Properties

Static EMPTY

EMPTY: DataSource<any> = ...

Accessors

dataSource

length

  • get length(): number
  • set length(length: number): void

source

  • get source(): any
  • Returns any

Static EVENT_TYPE

  • get EVENT_TYPE(): { UPDATED_LENGTH: "updated_length"; UPDATED_ORDER: "updated_order"; UPDATE_LENGTH: "update_length" }
  • Returns { UPDATED_LENGTH: "updated_length"; UPDATED_ORDER: "updated_order"; UPDATE_LENGTH: "update_length" }

    • UPDATED_LENGTH: "updated_length"
    • UPDATED_ORDER: "updated_order"
    • UPDATE_LENGTH: "update_length"

Methods

addEventListener

  • addEventListener(type: string, listener: AnyFunction): void
  • Parameters

    Returns void

dispose

  • dispose(): void
  • Returns void

fireListeners

  • fireListeners(type: string, ...args: any[]): any
  • Fires all registered listeners

    Parameters

    • type: string

      The type of the listeners to fire.

    • Rest ...args: any[]

      fire arguments

    Returns any

    the result of the last listener

get

getField

  • getField<F>(index: number, field: F): any

hasField

  • hasField(index: number, field: FieldDef<T>): boolean

hasListeners

  • hasListeners(type: string): boolean
  • Parameters

    • type: string

    Returns boolean

listen

  • Adds an event listener.

    Parameters

    • type: string

      The event type id.

    • listener: AnyFunction

      Callback method.

    Returns number

    unique id for the listener.

removeEventListener

  • removeEventListener(type: string, listener: AnyFunction): void
  • Parameters

    Returns void

setField

  • setField<F>(index: number, field: F, value: any): MaybePromise<boolean>

sort

unlisten

  • unlisten(id: number): void
  • Removes an event listener which was added with listen() by the id returned by listen().

    Parameters

    • id: number

      the id returned by listen().

    Returns void

Static ofArray

  • Type parameters

    • T

    Parameters

    • array: T[]

    Returns DataSource<T>

Generated using TypeDoc