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


PHP Mage_Adminhtml_Block_Widget_Grid::getId方法代码示例

本文整理汇总了PHP中Mage_Adminhtml_Block_Widget_Grid::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Adminhtml_Block_Widget_Grid::getId方法的具体用法?PHP Mage_Adminhtml_Block_Widget_Grid::getId怎么用?PHP Mage_Adminhtml_Block_Widget_Grid::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Adminhtml_Block_Widget_Grid的用法示例。


在下文中一共展示了Mage_Adminhtml_Block_Widget_Grid::getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: afterGridPrepareCollection

 public function afterGridPrepareCollection(Mage_Adminhtml_Block_Widget_Grid $grid)
 {
     $blockType = $grid->getType();
     $blockId = $grid->getId();
     if (!is_null($model = $this->_getGridModel($blockType, $blockId, true)) && !$model->getDisabled()) {
         if ($grid->getCollection()) {
             // Check grid model against grid columns
             $grid->getCollection()->load();
             $applyFromCollection = $model->checkColumnsAgainstGridBlock($grid);
             // Apply it to grid block (only apply from collection if it could be checked)
             $model->applyColumnsToGridBlock($grid, $applyFromCollection);
             // Finish to prepare grid collection
             $grid->blcg_finishPrepareCollection();
         } else {
             // If grid has no collection, check and apply directly
             $model->checkColumnsAgainstGridBlock($grid);
             $model->applyColumnsToGridBlock($grid, false);
         }
     }
 }
开发者ID:luizventurote,项目名称:mage-enhanced-admin-grids,代码行数:20,代码来源:Observer.php

示例2: initWithGridBlock

 /**
  * Init values with grid block instance
  * 
  * @param Mage_Adminhtml_Block_Widget_Grid $grid Grid block instance
  * @return this
  */
 public function initWithGridBlock(Mage_Adminhtml_Block_Widget_Grid $grid)
 {
     // Init global grid values
     $this->addData(array('block_id' => $grid->getId(), 'block_type' => $grid->getType()));
     $this->_initTypeModel();
     // Init columns
     $this->resetColumns();
     $order = 0;
     $gridIndexes = array();
     foreach ($grid->getColumns() as $column) {
         // Take all columns from grid
         $this->_addColumnFromBlock($column, ++$order * $this->getOrderPitch(), self::GRID_COLUMN_ORIGIN_GRID);
         $gridIndexes[] = $column->getIndex();
     }
     if ($grid->getCollection() && $grid->getCollection()->count() > 0) {
         // Initialize collection columns if possible
         $item = $grid->getCollection()->getFirstItem();
         foreach ($item->getData() as $key => $value) {
             if (!in_array($key, $gridIndexes, true) && !in_array($key, $this->_originIds[self::GRID_COLUMN_ORIGIN_GRID], true) && (is_scalar($value) || is_null($value))) {
                 /*
                 From collection, only take columns that are not already used by grid,
                 and do not correspond to array / object / resource values
                 */
                 $this->_addColumnFromCollection($key, ++$order * $this->getOrderPitch());
             }
         }
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:35,代码来源:Grid.php


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