Closed GoogleCodeExporter closed 9 years ago
Hi,
You can now define the search operator that will be applied for each column.
$grid->updateColumn('field',array('searchType'=>'>'));
$grid->updateColumn('field2',array('searchType'=>'='));
$grid->updateColumn('field3',array('searchType'=>'REGEXP'));
You can also use shortcuts into filters fields to use you operators:
=1
>1
<>3
Check this examples:
http://zfdatagrid.com/grid/site/index/filtersois/%7B%22filter_Name%22:%22%22,%22
filter_Continent%22:%22%22,%22filter_Population%22:%22%3D22720000%22,%22filter_L
ocalName%22:%22%22,%22filter_GovernmentForm%22:%22%22%7D
http://zfdatagrid.com/grid/site/index/filtersois/%7B%22filter_Name%22:%22%22,%22
filter_Continent%22:%22%22,%22filter_Population%22:%22%3C22720000%22,%22filter_L
ocalName%22:%22%22,%22filter_GovernmentForm%22:%22%22%7D
http://zfdatagrid.com/grid/site/index/filtersois/%7B%22filter_Name%22:%22r%3A%28
s|n%29%24%22,%22filter_Continent%22:%22%22,%22filter_Population%22:%22%22,%22fil
ter_LocalName%22:%22%22,%22filter_GovernmentForm%22:%22%22%7D
Here is the list of supported operators.
(Replace {{value}} for user submitted )
r:{{value}} // Will apply a regexp
12<>34//will do a between seacrh
=12// equal search
>=12// bigger or equal
>1//bigger
<12//less
<=12//Less or equal
!=21 //different
*12 // ends with 12
12* // starts with 12
*12* // contains 12
NEW:
12,13,14 // Values IN ()
Best Regards,
Bento Vilas Boas
Original comment by pao.fre...@gmail.com
on 23 Feb 2010 at 3:51
Thanks.
I have read search operators in the Wiki and in fact it is convenient.
But I was talking about a filter as a HTML SELECT element, whose items could be
customized, for ONE column.
Example:
Column A
[ ALL ]
| = X |
| IN (2,3) |
| > 0 |
Original comment by tribal...@gmail.com
on 23 Feb 2010 at 3:57
Hi,
Just apply the operator you want before:
Ex:
$filters = new Bvb_Grid_Filters();
$filters->addFilter('Population',array('values'=>array('<20000'=>'Less than
20.000','>=20000'=>'Greather than 20.000','=217000'=>'Equal to 217000')));
$grid->addFilters($filters);
Original comment by pao.fre...@gmail.com
on 23 Feb 2010 at 4:04
Ok, sorry :/
It is perfect !
Original comment by tribal...@gmail.com
on 23 Feb 2010 at 4:10
Original comment by bento.vi...@gmail.com
on 3 Mar 2010 at 4:56
Original issue reported on code.google.com by
tribal...@gmail.com
on 23 Feb 2010 at 3:17