Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class TBF_Cupom_Block_Adminhtml_Gerados_Index_Grid extends Mage_Adminhtml_Block_Widget_Form_Container
- //Mage_Adminhtml_Block_Widget_Grid
- {
- public function __construct()
- {
- parent::__construct();
- $this->_removeButton('add');
- // Set some defaults for our grid
- $this->setDefaultSort('id');
- $this->setId('foo_bar_index_grid');
- $this->setDefaultDir('asc');
- $this->setSaveParametersInSession(true);
- }
- protected function _getCollectionClass()
- {
- // This is the model we are using for the grid
- return 'foo/bar_collection';
- }
- protected function _prepareCollection()
- {
- // Get and set our collection for the grid
- $collection = Mage::getResourceModel($this->_getCollectionClass());
- $this->setCollection($collection);
- return parent::_prepareCollection();
- }
- protected function _prepareColumns()
- {
- // Add the columns that should appear in the grid
- $this->addColumn('id',
- array(
- 'header'=> $this->__('ID'),
- 'align' =>'right',
- 'width' => '50px',
- 'index' => 'id'
- )
- );
- $this->addColumn('name',
- array(
- 'header'=> $this->__('Name'),
- 'index' => 'name'
- )
- );
- return parent::_prepareColumns();
- }
- public function getRowUrl($row)
- {
- // This is where our row data will link to
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement