/** * @param string $name * @param null $title * @param SS_List $list */ public function __construct($name, $title = null, SS_List $list = null) { parent::__construct($name, $title, null); $this->name = $name; $this->grid = new GriddleField($name, $title, $list); $source = $this->getSource(); $source->addColumn('Action'); $source->addColumnMapping('canEdit', function ($record) { return $record->canEdit(Member::currentUser()); }); $source->addColumnMapping('canDelete', function ($record) { return $record->canEdit(Member::currentUser()); }); $source->addColumnMapping('Action', function () { return true; }); }
/** * @param string $name * @param null $title * @param SS_List $list */ public function __construct($name, $title = null, SS_List $list = null) { parent::__construct($name, $title, null); $this->name = $name; $this->source = new GriddleFieldSource($list); }