question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Light Column Filter plugin not working

See original GitHub issue

Hi everyone,

First of all, this is the versions i’m using.

  • jquery: 1.11.1
  • datatables: 1.10.12
  • angular-datatables: 0.5.6 (dev)

I have an AngularJs application with Angular Datatables and it works really well. I’m using some plugins like withFixedHeader (http://l-lin.github.io/angular-datatables/#/withFixedHeader) and it work’s fine too. But now, i need individual filters in my columns.

I tried columnFilter plugin but no success (i did not find dataTables columnFilter js file). Working with lightColumnFilter (http://l-lin.github.io/angular-datatables/#/withLightColumnFilter) it gives no error but filters are not added to the table, only a new row tr. Here’s a image of it.

lightfiltercolumn

Here’s also my controller js.

       vm.dtOptions = DTOptionsBuilder.fromFnPromise(function() {
            var defer = $q.defer();
            vm.mainService.getAll(subsegmento).then(function(result) {
                if (result.data.error === true) $location.path('/home/index');
                defer.resolve(result.data);
            });
            return defer.promise;
        })
        .withPaginationType('full_numbers').withOption('createdRow', createdRow)
        .withOption('headerCallback', function(header) {
            if (!vm.headerCompiled) {
                vm.headerCompiled = true;
                $compile(angular.element(header).contents())($scope);
            }
        })
        .withFixedHeader({ bottom: true })
        .withOption('deferRender', true)
        .withOption('initComplete', function() {
           angular.element('.dataTables_filter input').attr('placeholder','Buscar...'); 
           angular.element('.dataTables_filter input').addClass('form-control');
           angular.element('.dataTables_filter label').addClass('top_search');
           angular.element('#DataTables_Table_0_info').addClass('dataTables_info');
           angular.element('#DataTables_Table_0_paginate').addClass('datatable-responsive_paginate');
        })
        .withLightColumnFilter({
            '0' : { },
            '1' : { type : 'text' },
            '2' : { type : 'text' },
            '3' : { type : 'text' }
        });

        vm.dtColumns = [
                        DTColumnBuilder.newColumn('id').withTitle('ID'),
                        DTColumnBuilder.newColumn('ean').withTitle('ean'),
                        DTColumnBuilder.newColumn('name').withTitle('Nome'),
                        DTColumnBuilder.newColumn('n').withTitle('NCM'),
                        DTColumnBuilder.newColumn('subsegment_id').withTitle('Subsegmento')
        ];

Does anyone knows what’s happening?

Thanks for any help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
addariocommented, Jan 10, 2017

I made it work by importing the script versions of your site

<script src="http://l-lin.github.io/angular-datatables/archives/vendor/datatables-light-columnfilter/dist/dataTables.lightColumnFilter.min.js"></script> <script src="http://l-lin.github.io/angular-datatables/archives/dist/plugins/light-columnfilter/angular-datatables.light-columnfilter.js"></script>

I removed the scripts add by bower and I manually add the versions of your site and now is working

image

1reaction
izthucacommented, May 24, 2017

It works! Has anyone tried to implement the column filter search?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Individual column filter not working in Datatable - Stack Overflow
I am using jQuery DataTables @version 1.10.11. All thing is work but column Filter not working. what ...
Read more >
Column Filter plugin not working with GridView - DataTables
I am using a Gridview plugin which lets the DataTable plugin work with gridviews. ... But the column filters in the footer do...
Read more >
[Filter Custom Fields & Taxonomies Light] Support
Why this plugin is no more updated? ... Filter Custom Fields & Taxonomies Light / Result Page ... Want to buy but I...
Read more >
WooCommerce Product Table - Product Filters & Widgets
The WooCommerce Product Table plugin comes with various ways of filtering the table's contents. This article documents its filter dropdowns and widgets.
Read more >
Any Filter – John R. Ellis Lightroom Plugins
But Any Filter's column browser can display any field, including those with ... If you're not familiar with smart collections, I recommend you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found