Exemplo n.º 1
0
 public function __construct()
 {
     $this->id = 'SFMGrid';
     $this->source = SFM::table();
     $this->endpoint = __HOME__ . '/sfm/grid';
     $this->columns = ['id' => ['visible' => false], 'name' => ['label' => _('Name')], 'category' => ['label' => _('Category')], 'created' => ['label' => _('Created')], 'lastedit' => ['label' => _('Last edit')], 'command' => ['label' => _('Command'), 'field' => 'id', 'sortable' => false, 'html' => '<a href="' . __HOME__ . '/sfm/detail/id/{?}" class="btn btn-xs btn-success">' . _('View') . '</a> ' . '<a href="' . __HOME__ . '/sfm/modify/id/{?}" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-pencil"></i>' . _('Edit') . '</a> ' . '<button class="btn btn-xs btn-danger" type="button" data-toggle="modal" data-target="#modal-delete" data-delete-url="' . __HOME__ . '/sfm/delete/id/{?}"><i class="glyphicon glyphicon-trash"></i>' . _('Delete') . '</button>']];
     $this->events = ['row.click' => 'window.location = "' . __HOME__ . '/sfm/detail/id/"+id;'];
 }