Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AngularJS剑道树视图未更新_Angularjs_Kendo Ui_Angular Kendo - Fatal编程技术网

AngularJS剑道树视图未更新

AngularJS剑道树视图未更新,angularjs,kendo-ui,angular-kendo,Angularjs,Kendo Ui,Angular Kendo,多亏了“像Jared这样的词”的回答,我的树视图工作正常,一切都很好。直到-有人想根据复选框等更新/过滤treeview。我的问题是树不会更新以反映在控制器中对数据源所做的更改 基于上面提到的答案中的JSFIDLE,我创建了一个来显示我的问题 选中复选框不会影响树。 我是AngularJS和AngularKendo的新手,我想知道这种更新是否有效。我可能走错了方向。非常感谢您的帮助/建议 谢谢 您可以显式创建数据源,然后使用其API设置数据: $scope.thingsOptions = {

多亏了“像Jared这样的词”的回答,我的树视图工作正常,一切都很好。直到-有人想根据复选框等更新/过滤treeview。我的问题是树不会更新以反映在控制器中对数据源所做的更改

基于上面提到的答案中的JSFIDLE,我创建了一个来显示我的问题

选中复选框不会影响树。 我是AngularJS和AngularKendo的新手,我想知道这种更新是否有效。我可能走错了方向。非常感谢您的帮助/建议


谢谢

您可以显式创建数据源,然后使用其API设置数据:

$scope.thingsOptions = {
    dataSource: new kendo.data.HierarchicalDataSource({
        data: $scope.things1
    })
}
$scope.toggleFlag = function () {
    if ($scope.showLimitedRecords) {
        $scope.thingsOptions.dataSource.data($scope.things2);
    } else {
        $scope.thingsOptions.dataSource.data($scope.things1);
    }
}

()

您可以显式创建数据源,然后使用其API设置数据:

$scope.thingsOptions = {
    dataSource: new kendo.data.HierarchicalDataSource({
        data: $scope.things1
    })
}
$scope.toggleFlag = function () {
    if ($scope.showLimitedRecords) {
        $scope.thingsOptions.dataSource.data($scope.things2);
    } else {
        $scope.thingsOptions.dataSource.data($scope.things1);
    }
}
()