Infos
- Score: 96
- Required Symfony version: 2.*
- Created: 2011-05-17
- Nb of contributors: 11
- Nb of followers: 70
- S0RIEN/DataGridBundle
- sorien/datagrid-bundle
Keywords
datagridRecommendations
Score evolution
Score details ( ? )
- Github Followers: 70
- Last 30 days activity: 2.6
- README file size: 5
- Uses Travis CI: 0
- Travis CI build status: 0
- Provides a composer package: 5
- KnpBundles recommendations: 10
Contributors
Latest commits
- [BC Break] Show a message instead of an empty gridBy Abhoryo 17 days ago
- Fix Source mapping after the last commitBy Abhoryo 18 days ago
- Fix initFilters + Add initOrder methodBy Abhoryo 18 days ago
- Fix variable nameBy Abhoryo 18 days ago
- Add show and hide columns methodsBy Abhoryo 18 days ago
- fix render bloc ids and manipulate row field ids with mapping fields.By Abhoryo 18 days ago
- optimize persistence detectionBy Abhoryo 18 days ago
- [BC BREAK] Don't use previous data if the client leave the page during the session. You can turn on the persistence if you want the opposite.
- Fix createHash when you define a id for the grid + changelog
- Fix createHash when you define a id for the grid + changelog
Getting Started With DataGridBundle
Datagrid for Symfony2 inspired by Zfdatagrid and Magento Grid but not compatible.
Compatibility: Symfony 2.x
The following documents are available:
- Installation
- Grid Configuration
- Columns Configuration via annotations
- Multiple grids
- Overriding Templates
Special thanks to all contributors
Abhoryo, golovanov, touchdesign, Spea, nurikabe, print, Gregory McLean, centove, lstrojny, Benedikt Wolters, Martin Parsiegla, evan and all bug reporters
Simple grid with ORM or ODM as source
// MyProject\MyBundle\DefaultController.php
namespace MyProject\MyBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sorien\DataGridBundle\Grid\Source\Entity;
use Sorien\DataGridBundle\Grid\Source\Document;
class DefaultController extends Controller
{
public function myGridAction()
{
// Creates simple grid based on your entity (ORM)
$source = new Entity('MyProjectMyBundle:MyEntity');
// or use Document source class for ODM
$source = new Document('MyProjectMyBundle:MyDocument');
$grid = $this->get('grid');
// Mass actions, query and row manipulations are defined here
$grid->setSource($source);
// Columns, row actions are defined here
if ($grid->isReadyForRedirect())
{
// Data are stored, do redirect to prevent multiple post requests
return new RedirectResponse($grid->getRouteUrl());
}
else
{
// To obtain data for template simply pass in the grid instance
return $this->render('MyProjectMyBundle::my_grid.html.twig', array('data' => $grid));
}
}
}
Rendering inside twig
<!-- MyProject\MyBundle\Resources\views\my_grid.html.twig -->
{{ grid(data) }}
Working preview with assets

-
2012-02-15 Blair W
