예제 #1
0
파일: Component.php 프로젝트: Kaliver/grido
 /**
  * @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);
 }
예제 #2
0
파일: Operation.php 프로젝트: Kaliver/grido
 /**
  * @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;
 }
예제 #3
0
파일: Export.php 프로젝트: bombush/NatsuCon
 /**
  * @param Grid $grid
  * @param string $label
  */
 public function __construct(Grid $grid, $label = NULL)
 {
     $this->grid = $grid;
     $this->label = $label;
     $grid->addComponent($this, self::ID);
 }
예제 #4
0
파일: Export.php 프로젝트: novotnej/grido
 /**
  * @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);
 }