Skip to content

Commit

Permalink
Merge pull request #2 from PhilipRieck/nullfix
Browse files Browse the repository at this point in the history
Allow filtering of data when some keyed columns contain null
  • Loading branch information
tochoromero authored Aug 19, 2016
2 parents 77cf1ab + 4f9e242 commit 18a73c6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 21 deletions.
11 changes: 7 additions & 4 deletions dist/amd/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ define(["exports", "aurelia-framework"], function (exports, _aureliaFramework) {

var key = _ref2;

var value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key] != null) {
var value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
11 changes: 7 additions & 4 deletions dist/commonjs/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,14 @@ var AureliaTableCustomAttribute = exports.AureliaTableCustomAttribute = (_dec =

var key = _ref2;

var value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key] != null) {
var value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
11 changes: 7 additions & 4 deletions dist/es2015/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,14 @@ export let AureliaTableCustomAttribute = (_dec = inject(BindingEngine), _dec2 =

for (let next of toFilter) {
for (let key of this.filterKeys) {
let value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key] != null) {
let value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
11 changes: 7 additions & 4 deletions dist/system/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,14 @@ System.register(["aurelia-framework"], function (_export, _context) {

var key = _ref2;

var value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if (next[key] != null) {
var value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/au-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,17 @@ export class AureliaTableCustomAttribute {

doFilter(toFilter) {
let filteredData = [];

for (let next of toFilter) {
for (let key of this.filterKeys) {
let value = next[key].toString();

if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
if( next[key]!= null ){
let value = next[key].toString().toLowerCase();

if (value.indexOf(this.filterText.toLowerCase()) > -1) {
filteredData.push(next);
break;
}
}
}
}
Expand Down

0 comments on commit 18a73c6

Please sign in to comment.