Magento Admin Grid Issues

MarkR

New Member
Getting extremely confused with an adminhtml module i'm trying to write!Effectively I have the indexcontroller written and working, and i'm trying to call a grid block:\[code\]$<?phpclass MyTuxedo_OutOfStock_Block_Adminhtml_Web_Grid extends Mage_Adminhtml_Block_Widget_Grid{ public function __construct() { parent::__construct(); $this->setId('OOSGrid'); $this->setDefaultSort('OOS_id'); $this->setDefaultDir('ASC'); $this->setSaveParametersInSession(true);}protected function _prepareCollection(){ $collection = Mage::getModel('MyTuxedo/OutOfStock')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection();}protected function _prepareColumns(){ $this->addColumn('category_name', array( 'header' => Mage::helper('OutOfStock')->__('Category'), 'align' =>'right', 'width' => '50px', 'index' => 'web_id', )); $this->addColumn('sku', array( 'header' => Mage::helper('OutOfStock')->__('SKU'), 'align' =>'left', 'index' => 'title', ));/* $this->addColumn('quantity', array( 'header' => Mage::helper('OutOfStock')->__('Quantity Available'),'width' => '150px','index' => 'content', ));*/ $this->addColumn('Backorder allowed', array( 'header' => Mage::helper('OutOfStock')->__('Status'), 'align' => 'left', 'width' => '80px', 'index' => 'status', 'type' => 'options', 'options' => array( 1 => 'Enabled', 2 => 'Disabled', ), )); $this->addColumn('action', array( 'header' => Mage::helper('OutOfStock')->__('Action'), 'width' => '100', 'type' => 'action', 'getter' => 'getId', 'actions' => array( array( 'caption' => Mage::helper('OutOfStock')->__('Edit'), 'url' => array('base'=> '*/*/edit'), 'field' => 'id' ) ), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => true, ));$this->addExportType('*/*/exportCsv', Mage::helper('OutOfStock')->__('CSV'));$this->addExportType('*/*/exportXml', Mage::helper('OutOfStock')->__('XML')); return parent::_prepareColumns();} public function getRowUrl($row){ return $this->getUrl('*/*/edit', array('id' => $row->getId()));}\[/code\]I am using a controller to call the method through:\[code\]<?phpclass MyTuxedo_OutOfStock_IndexController extends Mage_Adminhtml_Controller_Action{public function indexAction(){ $this->loadLayout(); $this->_addContent($this->getLayout()->createBlock('OutOfStock/adminhtml_OutOfStock')); $this->renderLayout(); }}\[/code\]Layout file consists of the following:\[code\]<?xml version=
 
Back
Top