/** * 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'); }
/** * 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; }
/** * RecordView constructor. * * @param ViewComponentInterface $view */ public function __construct(ViewComponentInterface $view) { parent::__construct($view, static::ID, ManagedList::COLLECTION_VIEW_ID); }
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); }
/** * @param ViewComponentInterface|null $view * @return $this */ public function setView(ViewComponentInterface $view = null) { parent::setView($view); $this->setViewData(); return $this; }
/** * Renders components. * * @return string */ public function render() { $this->setViewData(); return parent::render(); }
/** * 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); }
/** * 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(); }