Class cc.TableView

Class Summary
Constructor Attributes Constructor Name and Description
 
UITableView counterpart for cocos2d for iphone.

Method Summary

Class Detail

cc.TableView()
UITableView counterpart for cocos2d for iphone. this is a very basic, minimal implementation to bring UITableView-like component into cocos2d world.

Field Detail

{cc.TableViewDataSource} dataSource
- The data source of the table view
- The event delegate of the table view
{Number} verticalFillOrder
- The index to determine how cell is ordered and filled in the view

Method Detail

  • {cc.TableViewCell} cellAtIndex(idx)
    Returns an existing cell at a given index. Returns nil if a cell is nonexistent at the moment of query.
    Parameters:
    idx
    index
    Returns:
    {cc.TableViewCell} a cell at a given index
  • <static> {cc.TableView} cc.TableView.create(dataSource, size, container)
    An initialized table view object
    Parameters:
    {cc.TableViewDataSource} dataSource
    data source;
    {cc.Size} size
    view size
    {cc.Node} container Optional
    parent object for cells
    Returns:
    {cc.TableView} table view
  • ctor(dataSource, size, container)
    The
    Parameters:
    dataSource
    size
    container
  • {TableViewCell} dequeueCell()
    Dequeues a free cell if available. nil if not.
    Returns:
    {TableViewCell} free cell
  • getDataSource()
    data source
  • getDelegate()
    delegate
  • insertCellAtIndex(idx)
    Inserts a new cell at a given index
    Parameters:
    idx
    location to insert
  • reloadData()
    reloads data from data source. the view will be refreshed.
  • removeCellAtIndex(idx)
    Removes a cell at a given index
    Parameters:
    idx
    index to find a cell
  • setVerticalFillOrder(fillOrder)
    determines how cell is ordered and filled in the view.
    Parameters:
    fillOrder
  • updateCellAtIndex(idx)
    Updates the content of the cell at a given index.
    Parameters:
    idx
    index to find a cell