07/02
2014
Wallogit.com
2017 © Pedro PelĂĄez
Propel behavior to automatically add filters for Sencha / ExtJS grids
Download the SenchagridableBehavior.php file in src/, put it somewhere on your project, then add the following line to your propel.ini:, (*1)
``` ini propel.behavior.senchagridable.class = path.to.SenchagridableBehavior, (*2)
Or use composer adding the requirement below: ``` js { "require": { "heristop/propel-senchagridable-behavior": "*" } }
Add this line to your schema.xml:, (*3)
``` xml
The Behavior will add several methods to the Query class: ``` php public function paginateGrid($params) public function addGridSortQuery($params) public function addGridFiltersQuery($params)
The variable $params contains the parameters retrieved from the request:, (*5)
php
$request = $this->get('request');
$posts = PostQuery::create()->paginateGrid($request->query);, (*6)