Class WindowedListModelAbstract

Windowed list abstract model.

Hierarchy

Implements

Constructors

Properties

_currentWindow: any
_estimatedWidgetSize: number

Default widget size estimation

_findNearestItem: any
_findNearestItemBinarySearch: any
_findNearestItemExponentialSearch: any
_getItemMetadata: any
_getRangeToRender: any
_getStartIndexForOffset: any
_getStopIndexForStartIndex: any
_height: any
_isDisposed: any
_itemsList: any
_lastMeasuredIndex: any
_overscanCount: any
_scrollOffset: any
_stateChanged: Signal<WindowedListModel, IChangedArgs<any, any, "index" | "list" | "count" | "overscanCount" | "windowingActive">>
_widgetCount: any
_widgetSizers: any
_windowingActive: any
estimateWidgetSize: ((index) => number)

Type declaration

    • (index): number
    • Provide a best guess for the widget size at position index

      Notes

      This function should be very light to compute especially when returning the default size. The default value should be constant (i.e. two calls with null should return the same value). But it can change for a given index.

      Parameters

      • index: number

        Widget position

      Returns number

      Estimated widget size

widgetRenderer: ((index) => Widget)

Type declaration

    • (index): Widget
    • Widget factory for the list items.

      Caching the resulting widgets should be done by the callee.

      Parameters

      • index: number

        List index

      Returns Widget

      The widget at the given position

Accessors

  • get height(): number
  • List widget height

    Returns number

  • set height(h): void
  • List widget height

    Parameters

    • h: number

    Returns void

  • get isDisposed(): boolean
  • Test whether the model is disposed.

    Returns boolean

  • get itemsList(): IObservableList<any>
  • Items list to be rendered

    Returns IObservableList<any>

  • set itemsList(v): void
  • Items list to be rendered

    Parameters

    Returns void

  • get overscanCount(): number
  • Number of widgets to render in addition to those visible in the viewport.

    Returns number

  • set overscanCount(newValue): void
  • Number of widgets to render in addition to those visible in the viewport.

    Parameters

    • newValue: number

    Returns void

  • get scrollOffset(): number
  • Viewport scroll offset.

    Returns number

  • set scrollOffset(offset): void
  • Viewport scroll offset.

    Parameters

    • offset: number

    Returns void

  • get widgetCount(): number
  • Total number of widgets in the list

    Returns number

  • set widgetCount(newValue): void
  • Total number of widgets in the list

    Parameters

    • newValue: number

    Returns void

  • get windowingActive(): boolean
  • Whether windowing is active or not.

    This is true by default.

    Returns boolean

  • set windowingActive(newValue): void
  • Whether windowing is active or not.

    Parameters

    • newValue: boolean

    Returns void

Methods

  • Dispose the model.

    Returns void

  • Get the total list size.

    Returns number

    Total estimated size

  • Get the scroll offset to display an item in the viewport.

    By default, the list will scroll as little as possible to ensure the item is visible. You can control the alignment of the item though by specifying a second alignment parameter. Acceptable values are:

    auto (default) - Scroll as little as possible to ensure the item is visible. (If the item is already visible, it won't scroll at all.) smart - If the item is already visible (including the margin), don't scroll at all. If it is less than one viewport away, scroll so that it becomes visible (including the margin). If it is more than one viewport away, scroll so that it is centered within the list. center - Center align the item within the list. end - Align the item to the end of the list start - Align the item to the beginning of the list

    Parameters

    • index: number

      Item index

    • Optional align: ScrollToAlign

      Where to align the item in the viewport

    • Optional margin: number

      In 'smart' mode the viewport proportion to add

    Returns number

    The needed scroll offset

  • Compute the items range to display.

    It returns null if the range does not need to be updated.

    Returns WindowIndex

    The current items range to display

  • Return the viewport top position and height for range spanning from startIndex to stopIndex.

    Parameters

    • startIndex: number

      First item in viewport index

    • stopIndex: number

      Last item in viewport index

    Returns [number, number]

    The viewport top position and its height

  • WindowedListModel caches offsets and measurements for each index for performance purposes. This method clears that cached data for all items after (and including) the specified index.

    The list will automatically re-render after the index is reset.

    Parameters

    • index: number

    Returns void

  • Update item sizes.

    This should be called when the real item sizes has been measured.

    Parameters

    • sizes: {
          index: number;
          size: number;
      }[]

      New sizes per item index

    Returns boolean

    Whether some sizes changed or not

Generated using TypeDoc