Example #1
0
 public function testCheckBox()
 {
     $column = new CheckBox($this->table, 'test');
     $column->setData(['test' => 1]);
     $output = $column->getValue();
     $this->assertTag(['tag' => 'label', 'child' => ['tag' => 'input', 'attributes' => ['type' => 'checkbox', 'class' => 'grid-view-checkbox', 'value' => '1', 'name' => 'test[]']]], $output);
 }
Example #2
0
 /**
  * @param $columnName
  * @return $this
  */
 public function addCheckBoxColumn($columnName)
 {
     if (is_scalar($columnName)) {
         $column = new CheckBox($this, $columnName);
     }
     if (is_array($columnName)) {
         $column = new CheckBox($this, $columnName);
     }
     $this->columns[] = $column;
     $this->addJavascript($column->getJavascript(), $column->getName());
     return $this;
 }