Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filtering of data when some keyed columns contain null #2

Merged
merged 3 commits into from
Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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