public function _prepareLayout() { parent::_prepareLayout(); $pager = $this->getLayout()->createBlock('page/html_pager', 'programs_pager')->setTemplate('affiliateplus/html/pager.phtml')->setCollection($this->getCollection()); $this->setChild('programs_pager', $pager); $grid = $this->getLayout()->createBlock('affiliateplus/grid', 'programs_grid'); // prepare column $grid->addColumn('id', array('header' => $this->__('No.'), 'align' => 'left', 'render' => 'getNoNumber')); $grid->addColumn('program_name', array('header' => $this->__('Program Name'), 'render' => 'getProgramName', 'filter_index' => 'IF (n.value IS NULL, main_table.name, n.value)', 'searchable' => true)); $grid->addColumn('details', array('header' => $this->__('Information'), 'render' => 'getProgramDetails')); $grid->addColumn('joined_at', array('header' => $this->__('Joined On'), 'type' => 'date', 'format' => 'medium', 'index' => 'joined_at', 'searchable' => true, 'filter_index' => 'account.joined')); $grid->addColumn('action', array('header' => $this->__('Action'), 'type' => 'action', 'action' => array('label' => $this->__('Opt out'), 'url' => 'affiliateplusprogram/index/out', 'name' => 'id', 'field' => 'program_id'))); $this->setChild('programs_grid', $grid); return $this; }
public function _prepareLayout() { parent::_prepareLayout(); $pager = $this->getLayout()->createBlock('page/html_pager', 'programs_pager')->setTemplate('affiliateplus/html/pager.phtml')->setCollection($this->getCollection()); $this->setChild('programs_pager', $pager); $grid = $this->getLayout()->createBlock('affiliateplus/grid', 'programs_grid'); $grid->addColumn('select', array('header' => '<input type="checkbox" onclick="selectProgram(this);" />', 'render' => 'getSelectProgram')); $grid->addColumn('id', array('header' => $this->__('No.'), 'align' => 'left', 'render' => 'getNoNumber')); $grid->addColumn('program_name', array('header' => $this->__('Program Name'), 'render' => 'getProgramName', 'filter_index' => 'IF (n.value IS NULL, main_table.name, n.value)', 'searchable' => true)); $grid->addColumn('details', array('header' => $this->__('Information'), 'render' => 'getProgramDetails')); $grid->addColumn('created_date', array('header' => $this->__('Date Created'), 'type' => 'date', 'format' => 'medium', 'index' => 'created_date', 'searchable' => true)); /*Changed By Adam: show priority 22/07/2014*/ $grid->addColumn('priority', array('header' => $this->__('Priority'), 'index' => 'priority', 'searchable' => true, 'filter_index' => 'IF (n.value IS NULL, main_table.priority, n.value)', 'width' => '50px')); $grid->addColumn('action', array('header' => $this->__('Action'), 'type' => 'action', 'action' => array('label' => $this->__('Join Program'), 'url' => 'affiliateplusprogram/index/join', 'name' => 'id', 'field' => 'program_id'))); $this->setChild('programs_grid', $grid); return $this; }