Example #1
0
 public function __construct(ORM $orm, array $columns = array(), $options = array())
 {
     $this->_options = $options;
     $this->set_name($orm->object_name());
     foreach ($columns as $name => $column) {
         if (!is_array($column)) {
             $column = array('type' => $column);
         }
         $column_cfg = array('name' => $name, 'header' => Arr::get($orm->labels(), $name), 'params' => Arr::get($column, 'params', array()));
         $column = Arr::merge($column_cfg, (array) $column);
         $column = Grid_Column::factory($column);
         $this[$name] = $column;
     }
     $this->_orm = $orm;
 }
Example #2
0
 public function __construct(array $column = array())
 {
     parent::__construct($column);
     $this->_template = Arr::get($column, 'template', $this->_template);
 }
Example #3
0
 public function __construct(array $column = array())
 {
     parent::__construct($column);
     $this->_resize = Arr::get($column, 'resize', $this->_resize);
 }
Example #4
0
 /**
  * Prepare Massactions
  * 
  * Prepares the massactions for the
  * grid
  * 
  * @access	public
  * @return	Spark\Grid
  */
 protected function _prepare_massactions()
 {
     // Check for massactions
     if ($this->get_massactions()->count()) {
         // Create a massaction column
         $massaction_column = \Grid_Column::factory('massactions', array('index' => $this->get_massactions_index(), 'type' => 'massaction', 'header' => 'Massactions', 'align' => 'center', 'width' => 30))->set_grid($this)->make_recursive();
         // Add the column
         $this->get_columns()->set_data('massactions', $massaction_column);
     }
     return $this;
 }