Skip to content

Commit

Permalink
Ignore empty/sparse rows for range filters
Browse files Browse the repository at this point in the history
  • Loading branch information
vedmack committed Jan 7, 2016
1 parent 167f7b4 commit 1e23a16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Destroy third party plugins on datatable destroy https://github.com/vedmack/yadcf/issues/213
* Prevent column sort when hitting Enter in filter https://github.com/vedmack/yadcf/issues/233
* Added data_as_is attribute to use when you want to define your own <option></option> for the filter https://github.com/vedmack/yadcf/issues/245
* Ignore empty/sparse rows for range filters https://github.com/vedmack/yadcf/issues/273
* Some of additional closed issues https://github.com/vedmack/yadcf/issues/227 / https://github.com/vedmack/yadcf/issues/236 / https://github.com/vedmack/yadcf/issues/257
https://github.com/vedmack/yadcf/issues/242 / https://github.com/vedmack/yadcf/issues/264 / https://github.com/vedmack/yadcf/issues/265 / https://github.com/vedmack/yadcf/issues/252
https://github.com/vedmack/yadcf/issues/270 / https://github.com/vedmack/yadcf/issues/262 / https://github.com/vedmack/yadcf/issues/272 / https://github.com/vedmack/yadcf/issues/263
Expand Down
11 changes: 9 additions & 2 deletions jquery.dataTables.yadcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Yet Another DataTables Column Filter - (yadcf)
*
* File: jquery.dataTables.yadcf.js
* Version: 0.8.9.beta.34 (grab latest stable from https://github.com/vedmack/yadcf/releases)
* Version: 0.8.9.beta.35 (grab latest stable from https://github.com/vedmack/yadcf/releases)
*
* Author: Daniel Reznick
* Info: https://github.com/vedmack/yadcf
Expand Down Expand Up @@ -1068,6 +1068,10 @@ var yadcf = (function ($) {
val = "";
}
}
//omit empty rows when filtering
if (val === '' && (min !== '' || max !== '')) {
return false;
}
min = (min !== "") ? (+min) : min;
max = (max !== "") ? (+max) : max;
if (columnObj.range_data_type === 'single') {
Expand Down Expand Up @@ -1202,7 +1206,10 @@ var yadcf = (function ($) {
}
}
}

//omit empty rows when filtering
if (val === '' && (min !== '' || max !== '')) {
return false;
}
try {
if (min.length === (date_format.length + 2) || columnObj.datepicker_type === 'bootstrap-datetimepicker') {
if (columnObj.datepicker_type === 'jquery-ui') {
Expand Down

0 comments on commit 1e23a16

Please sign in to comment.