本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Form::_prepareColumns方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Form::_prepareColumns方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Form::_prepareColumns怎么用?PHP Mage_Adminhtml_Block_Widget_Form::_prepareColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Adminhtml_Block_Widget_Form
的用法示例。
在下文中一共展示了Mage_Adminhtml_Block_Widget_Form::_prepareColumns方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareColumns
/**
* Add columns to grid
*
* @return Mage_Adminhtml_Block_Widget_Grid
*/
protected function _prepareColumns()
{
if (!$this->isReadonly()) {
$this->addColumn('in_products', array('header_css_class' => 'a-center', 'type' => 'checkbox', 'name' => 'in_products', 'values' => $this->_getSelectedProducts(), 'align' => 'center', 'index' => 'entity_id'));
}
$this->addColumn('entity_id', array('header' => Mage::helper('catalog')->__('ID'), 'sortable' => true, 'width' => 60, 'index' => 'entity_id'));
$this->addColumn('name', array('header' => Mage::helper('catalog')->__('Name'), 'index' => 'name'));
$this->addColumn('type', array('header' => Mage::helper('catalog')->__('Type'), 'width' => 100, 'index' => 'type_id', 'type' => 'options', 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray()));
$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())->load()->toOptionHash();
$this->addColumn('set_name', array('header' => Mage::helper('catalog')->__('Attrib. Set Name'), 'width' => 130, 'index' => 'attribute_set_id', 'type' => 'options', 'options' => $sets));
$this->addColumn('status', array('header' => Mage::helper('catalog')->__('Status'), 'width' => 90, 'index' => 'status', 'type' => 'options', 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray()));
$this->addColumn('visibility', array('header' => Mage::helper('catalog')->__('Visibility'), 'width' => 90, 'index' => 'visibility', 'type' => 'options', 'options' => Mage::getSingleton('catalog/product_visibility')->getOptionArray()));
$this->addColumn('sku', array('header' => Mage::helper('catalog')->__('SKU'), 'width' => 80, 'index' => 'sku'));
$this->addColumn('price', array('header' => Mage::helper('catalog')->__('Price'), 'type' => 'currency', 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE), 'index' => 'price'));
$this->addColumn('position', array('header' => Mage::helper('catalog')->__('Position'), 'name' => 'position', 'type' => 'number', 'validate_class' => 'validate-number', 'index' => 'position', 'width' => 60, 'editable' => !$this->_getProduct()->getRelatedReadonly(), 'edit_only' => !$this->_getProduct()->getId()));
return parent::_prepareColumns();
}