Filter

Warning If you use a filter together with a sortable, sortable will not work correctly.
Info It works with Related tabes.
Info False, true and null value in sources are fixed, can translate it by Localisation.

Method enableFilter

  • $inline if set FALSE, filter will be out from grid
$grid->enableSortable($inline = TRUE);

Getting filter values

$filter = $grid->enableFilter();

$values = $filter->getValues();

Change to out-line filter

//! disable in-line filter and set out-line
$grid->enableFilter(FALSE);

Event onFilter fired if is something filtered

Info See onFilteron events page

If no rows match

Info See Empty data page.

Usage

$mesourApp = //instance Mesour\Components\Application\IApplication
$source = //some <a href="http://components.mesour.com/version3/component/sources/" target="_blank">data source</a> or two-dimensional array

$grid = new Mesour\UI\DataGrid('filterDataGrid', $mesourApp);

$grid->setSource($source);

//! here enable filter
$grid->enableFilter();

$grid->addText('name', 'Name');

$grid->addText('surname', 'Surname');

$grid->addText('email', 'E-mail');

$grid->render();

Demo

Name Surname E-mailReset filter
JohnDoejohn.doe@test.xx
PeterLarsonpeter.larson@test.xx
ClaudeGravesclaude.graves@test.xx
StuartNormanstuart.norman@test.xx
KathyArnoldkathy.arnold@test.xx
JanWilsonjan.wilson@test.xx
AlbertaEricksonalberta.erickson@test.xx
AdaWellsada.wells@test.xx
EthelFigueroaethel.figueroa@test.xx
IanGoodwinian.goodwin@test.xx
FrancisHayesfrancis.hayes@test.xx
ErmaBurnserma.burns@test.xx
KristinaJenkinskristina.jenkins@test.xx
VirgilHuntvirgil.hunt@test.xx
MaxMartinmax.martin@test.xx
MelodyManningmelody.manning@test.xx
CatherineToddcatherine.todd@test.xx
DouglasStanleydouglas.stanley@test.xx
PattiDiazpatti.diaz@test.xx
JohnPettersonjohn.petterson@test.xx