datatables-bundle icon indicating copy to clipboard operation
datatables-bundle copied to clipboard

Filter column not displayed

Open FigaCZ opened this issue 5 years ago • 28 comments

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.

FigaCZ avatar Oct 13 '20 08:10 FigaCZ

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!

mash-potato47 avatar Nov 20 '20 09:11 mash-potato47

Same here.

Gerben321 avatar Feb 01 '21 20:02 Gerben321

+1

kapcus avatar May 21 '21 21:05 kapcus

+1

GFChris avatar May 24 '21 14:05 GFChris

Same here...

It could be nice to have documentation for this...

MadCat34 avatar Mar 10 '22 10:03 MadCat34

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

ducho avatar Apr 19 '22 10:04 ducho

nope, filter option doesn't work

RobQuistNL avatar Jul 22 '22 14:07 RobQuistNL

Stale issue message

github-actions[bot] avatar Nov 21 '22 22:11 github-actions[bot]

nah, not stale, just ignored :+)

RobQuistNL avatar Nov 22 '22 13:11 RobQuistNL

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.

curry684 avatar Nov 22 '22 22:11 curry684

There, now it has a label showing I also have no clue about how to solve this issue.

curry684 avatar Nov 22 '22 22:11 curry684

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 :+)

RobQuistNL avatar Nov 23 '22 20:11 RobQuistNL