当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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();
 }
开发者ID:roshu1980,项目名称:add-computers,代码行数:22,代码来源:Products+-+Copy.php


注:本文中的Mage_Adminhtml_Block_Widget_Form::_prepareColumns方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。