Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Grid:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getRowUrl ($row)
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Grid.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 37 of file Grid.php.

00038     {
00039         parent::__construct();
00040         $this->setId('answersGrid');
00041         $this->setDefaultSort('answer_id');
00042         $this->setDefaultDir('ASC');
00043         $this->setUseAjax(true);
00044     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 46 of file Grid.php.

00047     {
00048         $collection = Mage::getModel('poll/poll_answer')
00049             ->getResourceCollection()
00050             ->addPollFilter($this->getRequest()->getParam('id'));
00051         $this->setCollection($collection);
00052         return parent::_prepareCollection();
00053     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 55 of file Grid.php.

00056     {
00057         $this->addColumn('answer_id', array(
00058             'header'    => Mage::helper('poll')->__('ID'),
00059             'align'     =>'right',
00060             'width'     => '50px',
00061             'index'     => 'answer_id',
00062         ));
00063 
00064         $this->addColumn('answer_title', array(
00065             'header'    => Mage::helper('poll')->__('Answer Title'),
00066             'align'     =>'left',
00067             'index'     => 'answer_title',
00068         ));
00069 
00070         $this->addColumn('votes_count', array(
00071             'header'    => Mage::helper('poll')->__('Votes Count'),
00072             'type'      => 'number',
00073             'width'     => '50px',
00074             'index'     => 'votes_count',
00075         ));
00076 
00077         $this->addColumn('actions', array(
00078             'header'    => Mage::helper('poll')->__('Actions'),
00079             'align'     => 'center',
00080             'type'      => 'action',
00081             'width'     => '10px',
00082             'filter'    => false,
00083             'sortable'  => false,
00084             'actions'   => array(
00085                 array(
00086                     'caption'   => Mage::helper('poll')->__('Delete'),
00087                     'onClick'   => 'return answers.delete(\'$answer_id\')',
00088                     'url'       => '#',
00089                 ),
00090             ),
00091         ));
00092 
00093         return parent::_prepareColumns();
00094     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 101 of file Grid.php.

00102     {
00103         return $this->getUrl('*/poll_answer/grid', array('id' => $this->getRequest()->getParam('id')));
00104     }

getRowUrl ( row  ) 

Definition at line 96 of file Grid.php.

00097     {
00098         return $this->getUrl('*/poll_answer/edit', array('id' => $row->getId()));
00099     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:53 2009 for Magento by  doxygen 1.5.8