Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Symfony2 Datagrid Bundle (Sorien DataGridBundle 2.0)
branch: master

Merge pull request #685 from meron1122/master

Polish translate update
latest commit a3f7c16433
Petit Yoann authored

Datagrid for Symfony2 inspired by Zfdatagrid and Magento Grid.
This bundle was initiated by Stanislav Turza (Sorien).

Version: 2.1-dev - master-dev Compatibility: Symfony >= 2.0.0, Twig >= 1.5.0

Build Status



  • Supports Entity (ORM), Document (ODM) and Vector (Array) sources
  • Sortable and Filterable with operators (Comparison operators, range, starts/ends with, (not) contains, is (not) defined, regex)
  • Auto-typing columns (Text, Number, Boolean, Array, DateTime, Date, ...)
  • Locale support for DateTime, Date and Number columns (Decimal, Currency, Percent, Duration, Scientific, Spell out)
  • Input, Select, checkbox and radio button filters filled with the data of the grid or an array of values
  • Export (CSV, Excel, PDF, XML, JSON, HTML, ...)
  • Mass actions
  • Row actions
  • Supports mapped fields with Entity source
  • Securing the columns, actions and export with security roles
  • Annotations and PHP configuration
  • External filters box
  • Ajax loading
  • Pagination (You can also use Pagerfanta)
  • Column width and column align
  • Prefix translated titles
  • Grid manager for multi-grid on the same page
  • Groups configuration for ORM and ODM sources
  • Easy templates overriding (twig)
  • Custom columns and filters creation
  • ...


See the summary.


Full example with this CSS style file:


Simple example with the external filter box in english:


Same example in french:


Data used in these screenshots (this is a phpMyAdmin screenshot):


Simple grid with an ORM source

namespace MyProject\MyBundle\Controller;

use APY\DataGridBundle\Grid\Source\Entity;

class DefaultController extends Controller
    public function myGridAction()
        // Creates a simple grid based on your entity (ORM)
        $source = new Entity('MyProjectMyBundle:MyEntity');

        // Get a Grid instance
        $grid = $this->get('grid');

        // Attach the source to the grid

        // Return the response of the grid to the template
        return $grid->getGridResponse('MyProjectMyBundle::myGrid.html.twig');

Simple configuration of the grid in the entity

namespace MyProject\MyBundle\Entity

use Doctrine\ORM\Mapping as ORM;
use APY\DataGridBundle\Grid\Mapping as GRID;

 * @GRID\Source(columns="id, my_datetime")
class MyEntity
     * @ORM\Column(type="integer")
    protected $id;

     * @ORM\Column(type="datetime")
    protected $my_datetime;

Display the grid in a twig template

<!-- MyProject\MyBundle\Resources\views\myGrid.html.twig -->

{{ grid(grid) }}

And clear your cache.

Special thanks to all contributors

Abhoryo, golovanov, touchdesign, Spea, nurikabe, print, Gregory McLean, centove, lstrojny, Benedikt Wolters, Martin Parsiegla, evan and all bug reporters

Todo list

See this Pull Request

Something went wrong with that request. Please try again.