thansen-solire / datatables-light-columnfilter

DEPRECATED see https://github.com/polinome/datatables-lightcolumnfilter
12 stars 9 forks source link

NOT working on angular-datatables v0.5.x #19

Open victorhazbun opened 7 years ago

victorhazbun commented 7 years ago

After a long debug I found that the dataTables.lightColumnFilter.js and dataTables.lightColumnFilter.min.js are not working for angular-datatables.js http://l-lin.github.io/angular-datatables/archives/#/withLightColumnFilter

I have created a working version: https://gist.github.com/victorhazbun/b42a50c11933259b8df654acc2b7e350

Can you please fix this issue?

thansen-solire commented 7 years ago

I'll look into it this afternoon or tomorrow. Could you create a Pull request?

thansen-solire commented 7 years ago

@victorhazbun your changes to the file "src/dataTables.lightColumnFilter.js" can't be commited, you changed all the variables name, and removed all the comments. Can you explain what you changed?

zzzuzik commented 7 years ago

@thansen-solire All right, that was a nasty one :)

Based on the docs of angural-datatables: http://l-lin.github.io/angular-datatables/archives/#!/withLightColumnFilter Your current code fails with: TypeError: Cannot read property 'length' of undefined

I traced one line by one and found the troublemaker, line 201:

          $.each(self.options.attr, function(key, value){
            self.elements.attr(key,value);
          })

there is no check for the existence of attr Thus, attr is must exist for now, like:

                    '0': {
                        html: 'input',
                        type: 'text',
                        attr: {}
                    }

Will also update this issue: https://github.com/l-lin/angular-datatables/issues/928

Thank you for your work

thansen-solire commented 7 years ago

I encourage you to do a fix and then a pull request.

Thanks :)

KaustubhSrivastava commented 6 years ago

For me its adding a row and empty header column image

any help guys??