Interface CCTableViewDataSource

A table view data source provides the information necessary to construct a CCTableView. It reports the number of rows and columns in the table, as well as the size of columns and contents of each cell. A default implementation for basic data is available in CCTableViewStaticDataSource.

CCTableViewStaticDataSource

interface CCTableViewDataSource {
    contentsOfCell(table: CCTableView, row: number, column: number): CCView;
    numberOfColumns(table: CCTableView, row: number): number;
    numberOfRows(table: CCTableView): number;
    widthOfColumn(table: CCTableView, row: number, column: number): number;
}

Implemented by

Methods

  • Returns the content view for a cell.

    Parameters

    • table: CCTableView

      The table requesting data

    • row: number

      The row of the cell to get

    • column: number

      The column of the cell to get

    Returns CCView

    The view to display in the table; its position will be modified

  • Returns the number of columns in the table at the specified row.

    Parameters

    • table: CCTableView

      The table requesting data

    • row: number

      The row being queried

    Returns number

    The number of columns in the row

  • Returns the width of a column in a row, overriding the width of the view. If not implemented, the width is determined from the content.

    Parameters

    • table: CCTableView

      The table requesting data

    • row: number

      The row to query

    • column: number

      The column to query

    Returns number

    The width of the column