cdi / cdidatagrid
Zend Framework 2 Module that provides a datagrid
3.2.7
2017-01-30 20:14 UTC
Requires
- php: >=5.6
- zendframework/zend-code: ^2.6 || ^3.0
- zendframework/zend-http: ~2.2
- zendframework/zend-mvc: ^3.0.1
- zendframework/zend-paginator: ~2.2
- zendframework/zend-view: ~2.2
README
Zend Framework 2 module.
It allows you to render a datagrid from an Doctrine2 entity.
Features: Paginate, Filter, Order, Add, edit, view and delete records
Modulo para Zend Framework 2.
Permite renderizar un datagrid a partir de una entidad de Doctrine 2.
Caracteristicas: Paginar,Filtrar, Ordenar, Agregar, editar, visualizar y eliminar registros
##Ejemplo/Example:
Simple usage
$grid = $this->getServiceLocator()->get('cdiGrid'); $source = new \CdiDataGrid\DataGrid\Source\Doctrine($this->getEntityManager(), 'CdiCrm\Entity\Ticket'); $grid->setSource($source); $grid->setRecordsPerPage(5); $grid->prepare(); $view = new ViewModel(array('grid' => $grid)); return $view;
In View
<?php echo $this->CdiGrid($this->grid); ?>
Obs
-The default template need jQuery and Bootstrap
Functions
After "$grid->prepare();"
Hidden Column
$grid->hiddenColumn('columnName');
Change Column Visual Name
$grid->changeColumnName('columnName','newColumnName');
Set DateTime Column Format
$grid->datetimeColumn('createdAt', 'Y-m-d H:i:s');
Set render a column with a custom view helper
$grid->customHelperColumn('columnname',"ViewHelperName");
Set Template to Render
$grid->setTemplate("ajax");
Set a custom class to table
$grid->setTableClass("customClass table-condensed table-striped");
Set a custom class to Column (td)
$grid->classTdColumn('columnName', "customClass text-center col-md-1");
many more...