CCKit2
    Preparing search index...

    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 {
        columnIsSortable?(table: CCTableView, column: number): boolean;
        contentsOfCell(table: CCTableView, row: number, column: number): CCView;
        numberOfColumns(table: CCTableView, row: number): number;
        numberOfRows(table: CCTableView): number;
        titleForColumn?(table: CCTableView, column: number): string;
        widthOfColumn?(table: CCTableView, row: number, column: number): number;
    }

    Implemented by

    Index

    Methods

    • Returns whether the specified column is valid for sorting. The application must implement sorting columns on its own, using sortColumn on the table view.

      Parameters

      • table: CCTableView

        The table requesting data

      • column: number

        The 0-based column to query

      Returns boolean

      Whether the column can be used for sort order in the table

    • Returns the content view for a cell.

      Parameters

      • table: CCTableView

        The table requesting data

      • row: number

        The 0-based row of the cell to get

      • column: number

        The 0-based 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. The size of row 0 is used for header sizing.

      Parameters

      • table: CCTableView

        The table requesting data

      • row: number

        The 0-based row being queried

      Returns number

      The number of columns in the row

    • Returns the title for the specified column. If unimplemented, the table will not have a header row.

      Parameters

      • table: CCTableView

        The table requesting data

      • column: number

        The 0-based column to query

      Returns string

      The text showed in the header for the column

    • 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. The size of row 0 is used for header sizing.

      Parameters

      • table: CCTableView

        The table requesting data

      • row: number

        The 0-based row to query

      • column: number

        The 0-based column to query

      Returns number

      The width of the column