Skip to content

Commit

Permalink
Fix: default predicate should be undefined and not empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr authored and amirnissim committed Jan 14, 2014
1 parent 7e197d2 commit 4a15633
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rd_ui/app/scripts/smart-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
sortPredicate: '',
formatFunction: '',
formatParameter: '',
filterPredicate: '',
filterPredicate: undefined,
cellTemplateUrl: '',
headerClass: '',
cellClass: ''
Expand Down Expand Up @@ -184,7 +184,7 @@
replace: false,
link: function (scope, element, attr, ctrl) {

scope.searchValue = '';
scope.searchValue = undefined;

scope.$watch('searchValue', function (value) {
//todo perf improvement only filter on blur ?
Expand Down Expand Up @@ -464,14 +464,13 @@
* @param column
*/
this.search = function (input, column) {

//update column and global predicate
if (column && scope.columns.indexOf(column) !== -1) {
predicate.$ = '';
column.filterPredicate = input;
} else {
for (var j = 0, l = scope.columns.length; j < l; j++) {
scope.columns[j].filterPredicate = '';
scope.columns[j].filterPredicate = undefined;
}
predicate.$ = input;
}
Expand Down

0 comments on commit 4a15633

Please sign in to comment.