Filter column not displayed
Hello, maybe I didn't search docs deeply, but I am not able to get column filter displayed. I have this setup.
Controller:
$userFilter = new ChoiceFilter();
$userFilter->set([
'choices' => ['foo' => 'bar', 'bar' => 'baz']
]);
$table = $dataTableFactory->create()
->add('created_at', DateTimeColumn::class, ['label' => 'Datum', 'format' => 'j.n.Y H:i', "searchable" => false])
->add('userName', TextColumn::class, [
'label' => 'Uživatel',
"searchable" => true,
'render' => function ($value, $context) {
$user = $context->getUser();
return $user ? $user->getFirstname().' '.$user->getLastname() : '';
},
'filter' => $userFilter
])->createAdapter(ORMAdapter::class, [
'entity' => Copy::class,
])
`->handleRequest($request);
datatables.yaml
# Latest documentation available at https://omines.github.io/datatables-bundle/#configuration
datatables:
# Set options, as documented at https://datatables.net/reference/option/
options:
lengthMenu : [10, 25, 50, 100, 250, 500, 1000, 2500]
pageLength: 50
dom: "<'row' <'col-sm-12' ftr>><'row' <'col-sm-6'l><'col-sm-6 text-right'pi>>"
searching: true
template_parameters:
# Example classes to integrate nicely with Bootstrap 3.x
className: 'table table-striped table-bordered table-hover data-table'
columnFilter: "both"
# You can for example override this to "tables" to keep the translation domains separated nicely
translation_domain: 'messages'
I am not able to see column filter. What is wrong? Setup or datatable template. Thanks for reply.
I'm also experiencing this problem and as mentioned above there is no documentation about how to implement this properly.
Can anyone explain how this should be implemented - is there additional javascript required to get it working?
Thanks!
Same here.
+1
+1
Same here...
It could be nice to have documentation for this...
Hi everybody! Did anyone come up with something with that filter? The author ignores our questions and no documentation. @MadCat34 @kapcus @Gerben321 @FigaCZ @mash-potato47
nope, filter option doesn't work
Stale issue message
nah, not stale, just ignored :+)
I neither wrote nor use nor reviewed this feature: https://github.com/omines/datatables-bundle/pull/120
Not much I can do to help with an issue I don't really fully understand myself. I'm keeping it open so other people can help each other, that's how open source works.
There, now it has a label showing I also have no clue about how to solve this issue.
I neither wrote nor use nor reviewed this feature: #120
Not much I can do to help with an issue I don't really fully understand myself. I'm keeping it open so other people can help each other, that's how open source works.
I didn't mean it personal :) Just read it and it sounds a bit harsh, didn't mean it like that ;)
I have no clue on how to fix it either, otherwise I would have opened a PR :+)