vedmack / yadcf

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

Cumulative_filtering works badly with ajax #523

Open tynort opened 5 years ago

tynort commented 5 years ago

It is problem with cumulative_filtering with ajax sourced data. When we use ajax not working multiple selections. Second problem is with select2. In the latest version yadcf not woking yadcf-filter-reset-button. Here is an example: http://jsfiddle.net/0u932erv/2/

vedmack commented 5 years ago

@tynort the second is indeed a bug , but what wrong with the cumulative/ajax? indeed the cumulative can't allow selecting multiple values in the same drop down (see https://github.com/vedmack/yadcf/issues/255) , but its not related to ajax

tynort commented 5 years ago

In your example (http://yadcf-showcase.appspot.com/cumulative_filtering.html) cumulative and selecting multiple values works fine. image The problem only occurs when we provide ajax data.

vedmack commented 5 years ago

Not sure why, but in showcase the js code snippet is wrong, actually fist column's cumulative_filtering set to false

Heres the real code

yadcf.init(oTable, [ { column_number : 0, filter_type: "multi_select", select_type: 'select2', cumulative_filtering: false }, { column_number: 3, filter_type: "auto_complete", text_data_delimiter: "," }, { column_number : 4, filter_type: "multi_select", select_type: 'select2', column_data_type: "html", html_data_type: "text", filter_default_label: "Select tag" } ], { cumulative_filtering: true } );

for now this is how cumulative filtering works,

tynort commented 5 years ago

Thank you for your answer and for your time I found some example where is using ajax data source and it's working fine ("Last Name" and "Position" Columns) Here is this example https://jsfiddle.net/fojp91zx/25/. Thanks for your work

vedmack commented 5 years ago

thanks, but in that page cumulative filtering not working at all, no matter what value you chose from the multi select filters all other filters remain with the same value

tynort commented 5 years ago

What do you think about it : line 2922 if ((!columnObj.select_type_options || !columnObj.select_type_options.ajax) && $filter_selector[0].selectedIndex<0) after adding this argument, the current filter does not delete the selection option in this column