Skip to content

Commit 9ee2a1c

Browse files
authored
Merge pull request #102 from MayaKirova/master
Fix for bug #230041
2 parents 52265e5 + 497c3b1 commit 9ee2a1c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"grunt-contrib-uglify": "",
2323
"grunt-contrib-watch": "",
2424
"jshint-stylish": "",
25-
"protractor": "",
25+
"protractor": "4.0.14",
2626
"protractor-istanbul-plugin": "",
2727
"http-server": "",
2828
"bower": "",

src/igniteui-angular.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,18 @@
431431
$.ig.angular.igHierarchicalGrid.bindEvents = $.ig.angular.igHierarchicalGrid.bindEvents ||
432432
function (scope, element, attrs) {
433433
var unbinder;
434-
/* rebind data source on changes */
434+
// rebind data source on changes
435435
unbinder = scope.$watch(attrs.source, function (newValue) {
436-
$(element).igHierarchicalGrid("option", "dataSource", newValue);
436+
var ds = scope.$eval(attrs.source), grid = element.data("igHierarchicalGrid");
437+
438+
if (ds !== grid.options.dataSource) {
439+
//Setting a timeout 0 pushes the slow databind event to the end of the stack, letting the digest cycle finish, improving the overall responsivness of the page
440+
setTimeout(function () {
441+
$(element).igHierarchicalGrid("option", "dataSource", newValue);
442+
}, 0);
443+
return;
444+
}
445+
437446
}, true);
438447
markWatcher(scope, "igHierarchicalGrid", attrs);
439448
element.one("$destroy", function () {
@@ -756,4 +765,4 @@
756765
module.directive(control, igniteElementDirectiveConstructor);
757766
}
758767
}
759-
}(angular, jQuery));
768+
}(angular, jQuery));

0 commit comments

Comments
 (0)