Skip to content

Commit

Permalink
Fix for #522
Browse files Browse the repository at this point in the history
  • Loading branch information
jonricaurte committed Jul 1, 2013
1 parent 8101c46 commit a8508db
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 49 deletions.
12 changes: 6 additions & 6 deletions build/ng-grid.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 06/30/2013 22:01
* Compiled At: 07/01/2013 07:40
***********************************************/
(function(window, $) {
'use strict';
Expand Down Expand Up @@ -2484,14 +2484,14 @@ var ngSearchProvider = function ($scope, grid, $filter) {
f = $filter(s[0]);
}
var pVal = item[prop];
if (pVal != null) {
if (pVal !== null && pVal !== undefined) {
if (typeof f === "function") {
var filterRes = f(typeof pVal === 'object' ? evalObject(pVal, c.field) : pVal, s[1]).toString();
result = condition.regex.test(filterRes);
} else {
result = condition.regex.test(typeof pVal === 'object' ? evalObject(pVal, c.field).toString() : pVal.toString());
}
if (pVal && result) {
if (result) {
return true;
}
}
Expand All @@ -2507,7 +2507,7 @@ var ngSearchProvider = function ($scope, grid, $filter) {
var sp = col.cellFilter.split(':');
var filter = col.cellFilter ? $filter(sp[0]) : null;
var value = item[condition.column] || item[col.field.split('.')[0]];
if (value == null) {
if (value === null || value === undefined) {
return false;
}
if (typeof filter === "function") {
Expand All @@ -2517,7 +2517,7 @@ var ngSearchProvider = function ($scope, grid, $filter) {
else {
result = condition.regex.test(typeof value === "object" ? evalObject(value, col.field).toString() : value.toString());
}
if (!value || !result) {
if (!result) {
return false;
}
}
Expand Down Expand Up @@ -3304,7 +3304,7 @@ ngGridDirectives.directive('ngViewport', [function() {
$scope.$digest();
}
prevScollLeft = scrollLeft;
prevScollTop = prevScollTop;
prevScollTop = scrollTop;
isMouseWheelActive = false;
return true;
});
Expand Down
12 changes: 6 additions & 6 deletions build/ng-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 06/30/2013 22:01
* Compiled At: 07/01/2013 07:40
***********************************************/
(function(window, $) {
'use strict';
Expand Down Expand Up @@ -2181,14 +2181,14 @@ var ngSearchProvider = function ($scope, grid, $filter) {
f = $filter(s[0]);
}
var pVal = item[prop];
if (pVal != null) {
if (pVal !== null && pVal !== undefined) {
if (typeof f === "function") {
var filterRes = f(typeof pVal === 'object' ? evalObject(pVal, c.field) : pVal, s[1]).toString();
result = condition.regex.test(filterRes);
} else {
result = condition.regex.test(typeof pVal === 'object' ? evalObject(pVal, c.field).toString() : pVal.toString());
}
if (pVal && result) {
if (result) {
return true;
}
}
Expand All @@ -2203,7 +2203,7 @@ var ngSearchProvider = function ($scope, grid, $filter) {
var sp = col.cellFilter.split(':');
var filter = col.cellFilter ? $filter(sp[0]) : null;
var value = item[condition.column] || item[col.field.split('.')[0]];
if (value == null) {
if (value === null || value === undefined) {
return false;
}
if (typeof filter === "function") {
Expand All @@ -2213,7 +2213,7 @@ var ngSearchProvider = function ($scope, grid, $filter) {
else {
result = condition.regex.test(typeof value === "object" ? evalObject(value, col.field).toString() : value.toString());
}
if (!value || !result) {
if (!result) {
return false;
}
}
Expand Down Expand Up @@ -2948,7 +2948,7 @@ ngGridDirectives.directive('ngViewport', [function() {
$scope.$digest();
}
prevScollLeft = scrollLeft;
prevScollTop = prevScollTop;
prevScollTop = scrollTop;
isMouseWheelActive = false;
return true;
});
Expand Down
2 changes: 1 addition & 1 deletion build/ng-grid.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions ng-grid-2.0.7.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 06/30/2013 22:01
* Compiled At: 07/01/2013 07:40
***********************************************/
(function(window, $) {
'use strict';
Expand Down Expand Up @@ -2484,14 +2484,14 @@ var ngSearchProvider = function ($scope, grid, $filter) {
f = $filter(s[0]);
}
var pVal = item[prop];
if (pVal != null) {
if (pVal !== null && pVal !== undefined) {
if (typeof f === "function") {
var filterRes = f(typeof pVal === 'object' ? evalObject(pVal, c.field) : pVal, s[1]).toString();
result = condition.regex.test(filterRes);
} else {
result = condition.regex.test(typeof pVal === 'object' ? evalObject(pVal, c.field).toString() : pVal.toString());
}
if (pVal && result) {
if (result) {
return true;
}
}
Expand All @@ -2507,7 +2507,7 @@ var ngSearchProvider = function ($scope, grid, $filter) {
var sp = col.cellFilter.split(':');
var filter = col.cellFilter ? $filter(sp[0]) : null;
var value = item[condition.column] || item[col.field.split('.')[0]];
if (value == null) {
if (value === null || value === undefined) {
return false;
}
if (typeof filter === "function") {
Expand All @@ -2517,7 +2517,7 @@ var ngSearchProvider = function ($scope, grid, $filter) {
else {
result = condition.regex.test(typeof value === "object" ? evalObject(value, col.field).toString() : value.toString());
}
if (!value || !result) {
if (!result) {
return false;
}
}
Expand Down Expand Up @@ -3304,7 +3304,7 @@ ngGridDirectives.directive('ngViewport', [function() {
$scope.$digest();
}
prevScollLeft = scrollLeft;
prevScollTop = prevScollTop;
prevScollTop = scrollTop;
isMouseWheelActive = false;
return true;
});
Expand Down
2 changes: 1 addition & 1 deletion ng-grid-2.0.7.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/classes/searchProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
f = $filter(s[0]);
}
var pVal = item[prop];
if (pVal != null) {
if (pVal !== null && pVal !== undefined) {
if (typeof f === "function") {
var filterRes = f(typeof pVal === 'object' ? evalObject(pVal, c.field) : pVal, s[1]).toString();
result = condition.regex.test(filterRes);
} else {
result = condition.regex.test(typeof pVal === 'object' ? evalObject(pVal, c.field).toString() : pVal.toString());
}
if (pVal && result) {
if (result) {
return true;
}
}
Expand All @@ -51,7 +51,7 @@
var sp = col.cellFilter.split(':');
var filter = col.cellFilter ? $filter(sp[0]) : null;
var value = item[condition.column] || item[col.field.split('.')[0]];
if (value == null) {
if (value === null || value === undefined) {
return false;
}
if (typeof filter === "function") {
Expand All @@ -61,7 +61,7 @@
else {
result = condition.regex.test(typeof value === "object" ? evalObject(value, col.field).toString() : value.toString());
}
if (!value || !result) {
if (!result) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/directives/ng-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ngGridDirectives.directive('ngViewport', [function() {
$scope.$digest();
}
prevScollLeft = scrollLeft;
prevScollTop = prevScollTop;
prevScollTop = scrollTop;
isMouseWheelActive = false;
return true;
});
Expand Down
32 changes: 8 additions & 24 deletions workbench/main4.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,16 @@ function userController($scope) {
showColumnMenu: true,
enableColumnReordering: true,
enableColumnResize:true,
showFooter: true
showFooter: true,
showFilter: true
};

$scope.myData = [{ 'Sku': 'C-2820164', 'Vendor': 'NEWB', 'SeasonCode': 0, 'Mfg_Id': '573-9880954', 'UPC': '822860449228' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' },
{ 'Sku': 'J-8555462', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '780-8855467', 'UPC': '043208523549' },
{ 'Sku': 'K-5312708', 'Vendor': 'REEB', 'SeasonCode': 04, 'Mfg_Id': '355-6906843', 'UPC': '229487568922' }];
$scope.myData = [{ 'Sku': 'C-', 'Vendor': 'NEWB', 'SeasonCode': false, 'Mfg_Id': '573-', 'UPC': '' },
{ 'Sku': 'J-', 'Vendor': 'NIKE', 'SeasonCode': false, 'Mfg_Id': '-', 'UPC': '' },
{ 'Sku': 'K-', 'Vendor': 'REEB', 'SeasonCode': true, 'Mfg_Id': '355-', 'UPC': '' },
{ 'Sku': 'J-', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '-8855467', 'UPC': '' },
{ 'Sku': 'K-', 'Vendor': 'REEB', 'SeasonCode': true, 'Mfg_Id': '355-', 'UPC': '' },
{ 'Sku': 'J-', 'Vendor': 'NIKE', 'SeasonCode': 0, 'Mfg_Id': '-', 'UPC': '' }];


}

0 comments on commit a8508db

Please sign in to comment.