コード例 #1
0
 /**
  * SortingSelectControl constructor.
  *
  * @param string[] $fields
  * @param InputOption $fieldOption
  * @param InputOption $directionOption
  */
 public function __construct(array $fields, InputOption $fieldOption, InputOption $directionOption)
 {
     $this->fields = $fields;
     $this->fieldOption = $fieldOption;
     $this->directionOption = $directionOption;
     parent::__construct($this->makeDefaultView(), 'sorting_select', 'control_container');
 }
コード例 #2
0
ファイル: Column.php プロジェクト: view-components/grids
 /**
  * Sets title cell component ('th' tag).
  *
  * @param ContainerComponentInterface $cell
  * @return $this
  */
 public function setTitleCell(ContainerComponentInterface $cell)
 {
     $this->titleCell = $cell;
     $this->titleCell->children()->add($this->titleView, true);
     if ($this->titleCellPart !== null) {
         $this->titleCellPart->setView($cell);
     }
     return $this;
 }
コード例 #3
0
 /**
  * RecordView constructor.
  *
  * @param ViewComponentInterface $view
  */
 public function __construct(ViewComponentInterface $view)
 {
     parent::__construct($view, static::ID, ManagedList::COLLECTION_VIEW_ID);
 }
コード例 #4
0
ファイル: CsvExport.php プロジェクト: view-components/grids
 public function attachToCompound(Compound $root, $prepend = false)
 {
     // prepend component that will render results
     $root->children()->add(new DataView(function () {
         if ($this->inputOption->hasValue()) {
             $this->renderCsv();
         }
     }), true);
     parent::attachToCompound($root, $prepend);
 }
コード例 #5
0
 /**
  * @param ViewComponentInterface|null $view
  * @return $this
  */
 public function setView(ViewComponentInterface $view = null)
 {
     parent::setView($view);
     $this->setViewData();
     return $this;
 }
コード例 #6
0
 /**
  * Renders components.
  *
  * @return string
  */
 public function render()
 {
     $this->setViewData();
     return parent::render();
 }
コード例 #7
0
 /**
  * ResetButton constructor.
  *
  * @param string $text
  * @param array $attributes
  */
 public function __construct($text = 'Reset', array $attributes = ['style' => 'margin:2px;'])
 {
     $attributes['onclick'] = 'var form = jQuery(this).parents().filter("form");' . 'form.find("input:not([type=\'submit\']), select").val("");' . 'form.submit(); return false;';
     parent::__construct(new HtmlResetButton($text, $attributes), static::ID, ManagedList::CONTROL_CONTAINER_ID);
 }
コード例 #8
0
 /**
  * Renders component and returns output.
  *
  * @return string
  */
 public function render()
 {
     // try to update pagination one mor time for cases when not configured pagination was used and later configured.
     // (in this case we need to rewrite page_size again)
     $this->paginationControl && $this->updatePagination();
     $this->setViewData();
     return parent::render();
 }