Created
July 7, 2013 20:04
-
-
Save tsusanka/5944711 to your computer and use it in GitHub Desktop.
grido
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// v presenteru: | |
/** | |
* Datagrid for questions | |
* @param | |
*/ | |
protected function createComponentGrid($name) | |
{ | |
$grid = new Grido\Grid($this, $name); | |
$grid->setTemplateFile(__DIR__ . '/../components/grid.latte'); | |
$grid->addColumnText('text', 'Text'); | |
$grid->addColumnText('difficulty_level', 'Difficulty level'); | |
$grid->addColumnText('language_name', 'Language'); | |
$grid->addColumnText('state', 'State'); | |
$grid->addActionHref('edit', 'Edit') | |
->setIcon('pencil'); | |
$grid->addActionHref('delete', 'Delete') | |
->setIcon('trash') | |
->setConfirm(function($item) { | |
return "Do you really want to delete '{$item->text}' ?"; | |
}); | |
$grid->setModel($this->orm->questions->findAllActiveForDatagrid()); | |
} | |
?> | |
// v sablone pouze: | |
{control grid} | |
// a pak uz to mam jen nalinovany: | |
<link href="{$basePath}/css/bootstrap.min.css" rel="stylesheet" type="text/css"> | |
<link href="{$basePath}/css/grido.css" rel="stylesheet" type="text/css"> | |
<script src="{$basePath}/js/jquery.grido.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment