Skip to content

Instantly share code, notes, and snippets.

@tsusanka
Created July 7, 2013 20:04
Show Gist options
  • Save tsusanka/5944711 to your computer and use it in GitHub Desktop.
Save tsusanka/5944711 to your computer and use it in GitHub Desktop.
grido
<?
// 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