當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ActionsColumn::setSize方法代碼示例

本文整理匯總了PHP中APY\DataGridBundle\Grid\Column\ActionsColumn::setSize方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActionsColumn::setSize方法的具體用法?PHP ActionsColumn::setSize怎麽用?PHP ActionsColumn::setSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在APY\DataGridBundle\Grid\Column\ActionsColumn的用法示例。


在下文中一共展示了ActionsColumn::setSize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepare

 /**
  * Prepare Grid for Drawing
  *
  * @return self
  *
  * @throws \Exception
  */
 protected function prepare()
 {
     if ($this->prepared) {
         return $this;
     }
     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, $this->actionsColumnTitle, $rowActions);
                 if ($this->actionsColumnSize > -1) {
                     $actionColumn->setSize($this->actionsColumnSize);
                 }
                 $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)));
     }
     $this->prepared = true;
     return $this;
 }
開發者ID:deeky666,項目名稱:APYDataGridBundle,代碼行數:74,代碼來源:Grid.php


注:本文中的APY\DataGridBundle\Grid\Column\ActionsColumn::setSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。