Closed JanBRD closed 10 years ago
Hello Jan, you can use addFilterCustom() method like this:
$grid->addFilterCustom('gender', new Nette\Forms\Controls\MultiSelectBox('Gender', $items))
->setWhere(function($value, Nette\Database\Table\Selection $selection) {
$selection->where('gender IN ?', $value);
});
I just noticed Grido does not support multiselect.
Please add new add addFilterMultiSelect filter to allow to select multiple items by using Nette's MultiSelectBox component. Grido should display rows matching all selected items, so yes - IN SQL operator will make it.
Alternatively you can extend addFilterSelect by adding third parameter indicating multiSelect.
BTW - if you need boostrap css/js multiselect code, I found this: http://davidstutz.github.io/bootstrap-multiselect/ however any simple multiselect will be fine.
Thank you very much!!!