Beispiel #1
0
 /**
  * @param \Grido\Grid $grid
  * @param string $name
  * @return \Nette\ComponentModel\Container
  */
 protected function addComponentToGrid($grid, $name)
 {
     $this->grid = $grid;
     //check container exist
     $container = $this->grid->getComponent($this::ID, FALSE);
     if (!$container) {
         $this->grid->addComponent(new \Nette\ComponentModel\Container(), $this::ID);
         $container = $this->grid->getComponent($this::ID);
     }
     return $container->addComponent($this, $name);
 }
Beispiel #2
0
 /**
  * @param \Grido\Grid $grid
  * @param array $operations
  * @param callback $onSubmit - callback after operation submit
  */
 public function __construct($grid, array $operations, $onSubmit)
 {
     $this->grid = $grid;
     $grid->addComponent($this, self::ID);
     $grid['form'][$grid::BUTTONS]->addSubmit(self::ID, 'OK')->onClick[] = [$this, 'handleOperations'];
     $grid['form']->addContainer(self::ID)->addSelect(self::ID, 'Selected', $operations)->setPrompt('Grido.Selected');
     $grid->onRender[] = function (Grid $grid) {
         $this->addCheckers($grid['form'][Operation::ID]);
     };
     $this->onSubmit[] = $onSubmit;
 }
Beispiel #3
0
 /**
  * @param Grid $grid
  * @param string $label
  */
 public function __construct(Grid $grid, $label = NULL)
 {
     $this->grid = $grid;
     $this->label = $label;
     $grid->addComponent($this, self::ID);
 }
Beispiel #4
0
 /**
  * @param \Grido\Grid $grid
  * @param string $label
  */
 public function __construct(\Grido\Grid $grid, $label = NULL)
 {
     $this->grid = $grid;
     $this->label = $label === NULL ? ucfirst($this->grid->getName()) : $label;
     $grid->addComponent($this, self::ID);
 }