You can put expand_all()
function into setTimeout
function as below.(您可以按以下方式将expand_all()
函数放入setTimeout
函数中。)
setTimeout(function() {
$scope.my_tree.expand_all();
$scope.$digest();
}, 0);
It have to do because it take some delay time while binding data to treeview.(之所以必须这样做,是因为将数据绑定到Treeview时需要一些延迟时间。) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…