vedmack / yadcf

Yet Another DataTables Column Filter (yadcf)
http://yadcf-showcase.appspot.com/
MIT License
732 stars 284 forks source link

Filter not working on dynamic input in Firefox but in Chrome #602

Closed alex-seitz closed 5 years ago

alex-seitz commented 5 years ago

Hello, I have a table with an editable cell that I update using the infalidate().draw() method. The filters get updated in both browsers but the filtering itself only works in Chrome. In Firefox I only get an empty table.

I have attached an example file where this is the case. Here is a jFiddle: https://jsfiddle.net/alexseitz/sx9fgdw0/

This jFiddle shows that the data is present in the datatable and as I said, in Chrome the filtering works just fine.: https://jsfiddle.net/afs68Lg7/

Additionally, is it possible to also select empty cells. The only example I found was to add the empty fields manually to the filter, which I then can't update with the dynamic content of the editable fields

Thank you in advance

Alex

vedmack commented 5 years ago

@alex-seitz , Hi in both test pages the filtered column is empty

alex-seitz commented 5 years ago

Hi, you enter the Values in the contentEditable Fields. Afterwards the values are updated in the DataTable and can be selected in the Filter. However, the filtering itself only works in Chrome, in Firefox the result is always an empty table

vedmack commented 5 years ago

Its because of the
that for some reason are being added to the inputs,

I fixed it in 0.9.4.beta.31, you should add ignore_char: '<br>' to you filter

See working jsfiddle https://jsfiddle.net/su08z3f2/1/ (js file currently on my dropbox - lin in jsfiddle)

as to "empty cells." - please elaborate more about the scenario

alex-seitz commented 5 years ago

Thank you. It works great. With the empty fields, I mean that I want to show only the rows where I did not add anything to the editable fields, so only the ones I left blank. It is somewhat possible by adding the following two lines to the filter:

data: [ {value:'^$', label:'Empty' }],
filter_match_mode: 'regex'

but then the values I add to the cells no longer show up.

Best, Alex

vedmack commented 5 years ago

I think you looking for append_data_to_table_data property, read more in the yadcf js file (docs)

vedmack commented 5 years ago

@alex-seitz if it won't help you feel free to open a new issue with test page / scenario / expected / actual...

alex-seitz commented 5 years ago

@vedmack It works great, thank you for your help