diff --git a/ChangeLog.markdown b/ChangeLog.markdown index e8c3a61..79063d2 100644 --- a/ChangeLog.markdown +++ b/ChangeLog.markdown @@ -11,6 +11,7 @@ * Support Date Range Picker plugin (datepicker_type: 'daterangepicker') - https://github.com/vedmack/yadcf/issues/537 * Added column_data_type: 'html5_data_complex' type to parse value/display from datatable html5 attributes - https://github.com/vedmack/yadcf/issues/581 * Added range_data_type: 'delimiter' , to allow range slider filter to handle multiple values per cell - https://github.com/vedmack/yadcf/issues/580 +* Added initOnDtXhrComplete: Allows to set a callback function to be called after dt xhr finishes - https://github.com/vedmack/yadcf/issues/609 * 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 @@ -34,6 +35,7 @@ https://github.com/vedmack/yadcf/issues/587 - Applying style_class to range_date uses the wrong element https://github.com/vedmack/yadcf/issues/602 - Filter not working on dynamic input in Firefox but in Chrome https://github.com/vedmack/yadcf/issues/603 - Date range with jquery-ui datepicker disables "future" dates even after they have been cleared + ## 0.9.3 diff --git a/src/jquery.dataTables.yadcf.js b/src/jquery.dataTables.yadcf.js index 7037b1c..47e3cb9 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.33 +* Version: 0.9.4.beta.35 * * Author: Daniel Reznick * Info: https://github.com/vedmack/yadcf @@ -472,7 +472,12 @@ Arguments: table_arg: variable of the datatable col_num: number index of column filter updatedData: array of new data (use same data structure as was used in yadcf.init options) - Usage example: yadcf.exRefreshColumnFilterWithDataProp(table_arg, 5, ['One', 'Two', 'Three']); + Usage example: yadcf.exRefreshColumnFilterWithDataProp(table_arg, 5, ['One', 'Two', 'Three']); +* initOnDtXhrComplete + Description: Allows to set a callback function to be called after dt xhr finishs + Arguments: function to do some logic + Usage example: yadcf.initOnDtXhrComplete(function() { $("#yadcf-filter--example-0").multiselect('refresh'); }); + * * * @@ -600,7 +605,8 @@ if (!Object.entries) { range: ['From', 'To'], date: 'Select a date' }, - settingsMap = {}; + settingsMap = {}, + dTXhrComplete; let ctrlPressed = false; let closeBootstrapDatepicker = false; @@ -957,6 +963,10 @@ if (!Object.entries) { selectElementCustomDestroyFunc = destroyFunc; } + function initOnDtXhrComplete(initFunc) { + dTXhrComplete = initFunc; + } + //Used by exFilterColumn for translating readable search value into proper search string for datatables filtering function yadcfMatchFilterString(table_arg, column_number, selected_value, filter_match_mode, multiple, exclude) { var case_insensitive = yadcf.getOptions(table_arg.selector)[column_number].case_insensitive, @@ -4675,6 +4685,11 @@ if (!Object.entries) { } } } + if (dTXhrComplete !== undefined ) { + yadcfDelay(function () { + dTXhrComplete(); + }, 100); + } }); } } @@ -5675,7 +5690,8 @@ if (!Object.entries) { initSelectPluginCustomTriggers: initSelectPluginCustomTriggers, preventDefaultForEnter: preventDefaultForEnter, generateTableSelectorJQFriendly2: generateTableSelectorJQFriendly2, - exRefreshColumnFilterWithDataProp: exRefreshColumnFilterWithDataProp + exRefreshColumnFilterWithDataProp: exRefreshColumnFilterWithDataProp, + initOnDtXhrComplete: initOnDtXhrComplete }; }());