/** * Setup the columns for the table. * * @return void */ protected function _init() { // Setup the columns $this->appendColumn(new Ztal_Table_Column_Array('firstColumn', 'col1', array('sortField' => 'col1'))); $this->appendColumn(new Ztal_Table_Column_Array('secondColumn', 'col2', array('sortField' => 'col2'))); // Set defaults for the table as a whole $this->setId('basicTable'); $this->setBaseUri('/default/index/table'); $this->setSortColumn('firstColumn'); // Configure the paginator $paginator = new Ztal_Table_Paginator_Array(); $paginator->setRowsPerPage(2); $this->setPaginator($paginator); }
/** * Setup the columns for the table. * * @return void */ protected function _init() { // Setup the columns $this->appendColumn(new Ztal_Table_Column_Object('age', 'getAge', array('sortField' => 'sortByAge'))); $this->appendColumn(new Ztal_Table_Column_Object('height', 'getHeight', array('sortField' => 'sortByHeight'))); // Set defaults for the table as a whole $this->setId('objectTable'); $this->setBaseUri('/default/index/object-table'); $this->setSortColumn('age'); // Configure the paginator $paginator = new Ztal_Table_Paginator_Array(); $paginator->setRowsPerPage(4); $this->setPaginator($paginator); }