【问题标题】:Keno UI TreeView Angular JS:- How to select the newly added item?Kendo UI TreeView Angularjs:- 如何选择新添加的项目?
【发布时间】:2016-12-19 16:10:42
【问题描述】:

我有一个问题。我可以使用TreeView With AngularJS 向树视图中添加一个新项目,但我不能将这个新项目设为所选项目。 如何选择这个新项目? 这是我用来向树中添加新项目的代码。

var newCreatedCompanyHierarchyItem = this.createNewCompanyHierarchyItem();
        this.$scope.tree.append(newCreatedCompanyHierarchyItem,   this.$scope.tree.select());

【问题讨论】:

    标签: angularjs kendo-ui kendo-treeview


    【解决方案1】:

    append() 方法有一个回调参数,一旦添加了新项目(如果需要,在远程获取同级之后)就会调用该参数。回调的参数是附加的<li> 元素,可用于选择它:

    var addedElement = this.$scope.tree.append(newCreatedCompanyHierarchyItem, this.$scope.tree.select(), function (e) {
        $scope.tree.select(e);
    }));
    

    简单示例:http://dojo.telerik.com/@Stephen/OxOMe

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多