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


PHP ActionsColumn::setSeparator方法代码示例

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


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

示例1: prepare

 /**
  * Prepare Grid for Drawing
  *
  * @return self
  *
  * @throws \Exception
  */
 protected function prepare()
 {
     if ($this->source->isDataLoaded()) {
         $this->rows = $this->source->executeFromData($this->columns->getIterator(true), $this->page, $this->limit, $this->maxResults);
     } else {
         $this->rows = $this->source->execute($this->columns->getIterator(true), $this->page, $this->limit, $this->maxResults, $this->dataJunction);
     }
     if (!$this->rows instanceof Rows) {
         throw new \Exception('Source have to return Rows object.');
     }
     if (count($this->rows) == 0 && $this->page > 0) {
         $this->page = 0;
         $this->prepare();
         return $this;
     }
     //add row actions column
     if (count($this->rowActions) > 0) {
         foreach ($this->rowActions as $column => $rowActions) {
             if ($actionColumn = $this->columns->hasColumnById($column, true)) {
                 $actionColumn->setRowActions($rowActions);
             } else {
                 $actionColumn = new ActionsColumn($column, 'Actions', $rowActions);
                 if ($this->actionsColumnSize > -1) {
                     $actionColumn->setSize($this->actionsColumnSize);
                 }
                 if (isset($this->actionsColumnSeparator)) {
                     $actionColumn->setSeparator($this->actionsColumnSeparator);
                 }
                 $this->columns->addColumn($actionColumn);
             }
         }
     }
     //add mass actions column
     if (count($this->massActions) > 0) {
         $this->columns->addColumn(new MassActionColumn(), 1);
     }
     $primaryColumnId = $this->columns->getPrimaryColumn()->getId();
     foreach ($this->rows as $row) {
         $row->setPrimaryField($primaryColumnId);
     }
     //@todo refactor autohide titles when no title is set
     if (!$this->showTitles) {
         $this->showTitles = false;
         foreach ($this->columns as $column) {
             if (!$this->showTitles) {
                 break;
             }
             if ($column->getTitle() != '') {
                 $this->showTitles = true;
                 break;
             }
         }
     }
     //get size
     if ($this->source->isDataLoaded()) {
         $this->source->populateSelectFiltersFromData($this->columns);
         $this->totalCount = $this->source->getTotalCountFromData($this->maxResults);
     } else {
         $this->source->populateSelectFilters($this->columns);
         $this->totalCount = $this->source->getTotalCount($this->maxResults);
     }
     if (!is_int($this->totalCount)) {
         throw new \Exception(sprintf('Source function getTotalCount need to return integer result, returned: %s', gettype($this->totalCount)));
     }
     return $this;
 }
开发者ID:radmar,项目名称:APYDataGridBundle,代码行数:73,代码来源:Grid.php


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