yadcf icon indicating copy to clipboard operation
yadcf copied to clipboard

Cumulative_filtering works badly with ajax

Open tynort opened this issue 6 years ago • 6 comments

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/

tynort avatar Dec 06 '18 12:12 tynort

@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

vedmack avatar Dec 06 '18 13:12 vedmack

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.

tynort avatar Dec 06 '18 13:12 tynort

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,

vedmack avatar Dec 09 '18 10:12 vedmack

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

tynort avatar Dec 10 '18 08:12 tynort

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

vedmack avatar Dec 11 '18 11:12 vedmack

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

tynort avatar Feb 28 '19 10:02 tynort