Class VirtualizedDataSource

Serves as the base class for a custom IListDataSource.

Index

Constructor methods

Methods

Constructor methods

constructor(listDataAdapter: IListDataAdapter, options?: any): VirtualizedDataSource

Initializes the VirtualizedDataSource base class of a custom data source.

constructor

Parameters

  • listDataAdapter: IListDataAdapter

    The object that supplies data to the VirtualizedDataSource.

  • options?: any optional

    An object that can contain properties that specify additional options for the VirtualizedDataSource. It supports these properties: cacheSize.

Returns

VirtualizedDataSource

Methods

public addEventListener(eventName: string, eventHandler: Function, useCapture?: boolean)

Registers an event handler for the specified event.

Parameters

  • eventName: string

    The name of the event to handle. See the VirtualizedDataSource object page for a list of events. Note that you drop the "on" when specifying the event name for the addEventListener method. For example, instead of specifying "onstatuschanged", you specify "statuschanged".

  • eventHandler: Function

    The event handler function to associate with the event.

  • useCapture?: boolean optional

    Set to true to register the event handler for the capturing phase; otherwise, set to false to register the event handler for the bubbling phase.

public dispatchEvent(type: string, eventProperties: any): boolean

Raises an event of the specified type and with additional properties.

Parameters

  • type: string

    The type (name) of the event.

  • eventProperties: any

    The set of additional properties to be attached to the event object when the event is raised.

Returns

boolean

true if preventDefault was called on the event, otherwise false.

public removeEventListener(eventName: string, eventCallback: Function, useCapture?: boolean)

Removes an event handler that the addEventListener method registered.

Parameters

  • eventName: string

    The name of the event that the event handler is registered for. See the VirtualizedDataSource object page for a list of events.

  • eventCallback: Function

    The event handler function to remove.

  • useCapture?: boolean optional

    Set to true to remove the capturing phase event handler; set to false to remove the bubbling phase event handler.

public statuschanged(eventInfo: CustomEvent)

Occurs when the status of the VirtualizedDataSource changes.

Parameters

  • eventInfo: CustomEvent

    An object that contains information about the event. The detail property of this object contains the following sub-properties: status.