Hosanna UI API v1.30.2-next
    Preparing search index...

    BaseCell

    Base class for collection view cells that provides core cell functionality including content management, recycling, and rendering capabilities.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _cacheKey: string = ''

    The cache key for the cell. Initialized to an empty string by default.

    _hid: string = ''

    Internal hierarchical identifier for the cell

    index: number = -1

    The index of the cell in the list. Initialized to -1 by default.

    item?: IIdentifiable

    The item property represents an identifiable entity that will be used within the BaseCell component. It is expected to implement the IIdentifiable interface.

    Reference to the row that contains this cell

    viewStatus: ViewStatus = ViewStatus.Normal

    Current status of the view

    Methods

    • Returns number

    • Returns void

      recycle

      Resets the cell to its initial state and sets the view status to Normal

    • Renders the cell at the specified coordinates.

      Parameters

      • x: number

        The x-coordinate where the cell should be rendered.

      • y: number

        The y-coordinate where the cell should be rendered.

      Returns void

      This method should be overridden in a subclass to provide the actual rendering logic.

    • Resets the cell by setting item and row to undefined. This method does not remove any view fragment.

      Returns void

    • Sets the item and updates the cell size based on the provided row. If the row is undefined, it defaults the cell size to [640, 480]. If the new item is the same as the current item, it does nothing. Otherwise, it updates the item and triggers the changeRowHidden method.

      For variable width rows, the cell width is retrieved from the layout's cellWidths array. If variable widths are not yet available (e.g., for dynamic rows before OnContentReady), it falls back to the row's default cellSize.

      Parameters

      • row: IBaseCollectionViewRow

        The row that this cell belongs to

      • Optionalitem: IIdentifiable

        The new item to be set.

      Returns void

    • Parameters

      • visible: boolean

        Boolean indicating whether the cell should be visible

      Returns void

      setVisible

      Controls the visibility of the cell