__construct() public method

public __construct ( Grid $grid, string $name, string $label )
$grid Grido\Grid
$name string
$label string
Example #1
0
 /**
  * @param \Grido\Grid $grid
  * @param string $name
  * @param string $label
  * @param callable $onClick
  * @throws Exception
  */
 public function __construct($grid, $name, $label, $onClick = NULL)
 {
     parent::__construct($grid, $name, $label);
     if ($onClick === NULL) {
         $grid->onRender[] = function (Grid $grid) {
             if ($this->onClick === NULL) {
                 throw new Exception("Callback onClick in action '{$this->name}' must be set.");
             }
         };
     } else {
         $this->setOnClick($onClick);
     }
 }