diff --git a/ChangeLog.markdown b/ChangeLog.markdown index 7176d14..64b2a7d 100644 --- a/ChangeLog.markdown +++ b/ChangeLog.markdown @@ -6,6 +6,7 @@ * Misc bug fixed issues: https://github.com/vedmack/yadcf/issues/469 - Cannot apply style_class on date filter https://github.com/vedmack/yadcf/issues/470 - filter_delay not working on range_date + https://github.com/vedmack/yadcf/issues/482 - Autocomplete is not reading filter_plugin_options ## 0.9.3 diff --git a/src/jquery.dataTables.yadcf.js b/src/jquery.dataTables.yadcf.js index 088c353..672c087 100644 --- a/src/jquery.dataTables.yadcf.js +++ b/src/jquery.dataTables.yadcf.js @@ -2,7 +2,7 @@ * Yet Another DataTables Column Filter - (yadcf) * * File: jquery.dataTables.yadcf.js -* Version: 0.9.4.beta.2 +* Version: 0.9.4.beta.3 * * Author: Daniel Reznick * Info: https://github.com/vedmack/yadcf @@ -3051,14 +3051,18 @@ if (!Object.entries) { $(filter_selector_string).find(".yadcf-filter").val($(document).data("#yadcf-filter-" + table_selector_jq_friendly + "-" + column_number + "_val")); } if (columnObj.filter_type === "auto_complete") { - columnObj.filter_plugin_options = { + let autocompleteObj = { source: $(document).data("yadcf-filter-" + table_selector_jq_friendly + "-" + column_number), select: autocompleteSelect }; if (columnObj.externally_triggered === true) { - delete columnObj.filter_plugin_options.select; + delete autocompleteObj.select; } - $("#yadcf-filter-" + table_selector_jq_friendly + "-" + column_number).autocomplete(columnObj.filter_plugin_options); + if (columnObj.filter_plugin_options !== undefined) { + $.extend(autocompleteObj, columnObj.filter_plugin_options); + } + + $("#yadcf-filter-" + table_selector_jq_friendly + "-" + column_number).autocomplete(autocompleteObj); if (settingsDt.aoPreSearchCols[column_position].sSearch !== '') { tmpStr = settingsDt.aoPreSearchCols[column_position].sSearch; tmpStr = yadcfParseMatchFilter(tmpStr, getOptions(oTable.selector)[column_number].filter_match_mode);