Skip to content

Commit

Permalink
0.9.4.beta.35
Browse files Browse the repository at this point in the history
Added initOnDtXhrComplete: Allows to set a callback function to be called after dt xhr finishes - #609
  • Loading branch information
vedmack committed Dec 9, 2019
1 parent 2c85f07 commit ae98232
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 20 additions & 4 deletions src/jquery.dataTables.yadcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'); });
*
*
*
Expand Down Expand Up @@ -600,7 +605,8 @@ if (!Object.entries) {
range: ['From', 'To'],
date: 'Select a date'
},
settingsMap = {};
settingsMap = {},
dTXhrComplete;

let ctrlPressed = false;
let closeBootstrapDatepicker = false;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -4675,6 +4685,11 @@ if (!Object.entries) {
}
}
}
if (dTXhrComplete !== undefined ) {
yadcfDelay(function () {
dTXhrComplete();
}, 100);
}
});
}
}
Expand Down Expand Up @@ -5675,7 +5690,8 @@ if (!Object.entries) {
initSelectPluginCustomTriggers: initSelectPluginCustomTriggers,
preventDefaultForEnter: preventDefaultForEnter,
generateTableSelectorJQFriendly2: generateTableSelectorJQFriendly2,
exRefreshColumnFilterWithDataProp: exRefreshColumnFilterWithDataProp
exRefreshColumnFilterWithDataProp: exRefreshColumnFilterWithDataProp,
initOnDtXhrComplete: initOnDtXhrComplete
};

}());
Expand Down

0 comments on commit ae98232

Please sign in to comment.