Example #1
0
 /**
  * Sets some common-sense options based on the underlying data model.
  *
  * @param Model $model
  * @return $this
  */
 public function setOptionsFromModel($model)
 {
     if (!$model) {
         return $this;
     }
     if ($model->is_sortable && in_array($this->getField(), $model->getSortable())) {
         // The model dictates that this column should be sortable
         $this->setSortable(true);
     }
     $this->model = $model;
     return $this;
 }