當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。