This is a migrated thread and some comments may be shown as answers.

Tree node clone after node append

3 Answers 125 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Evgen
Top achievements
Rank 1
Evgen asked on 04 Dec 2012, 10:20 PM
I got dataSource config
new kendo.data.HierarchicalDataSource({
                   transport: {
                        read: {
                            url: '/getnodes'
                        }
                    },
                    schema: {
                        model: {
                            id: '_id'
                        }
                    }
                })

also I have a method wich provide adding nodes to treeview
addNode: function() {
     var tree = this.tree, //this.tree == $('#treeview').(/* config here */).data('kendoTreeView')
           sel = tree.select();

       /* some code here */

      $.ajax({
           url: '/addnode',
           data: {parent: parent},
           success: function(row) {
              el.append({
                        _id: row._id,
                        name: row.name
                    }, sel);
           }
      })
}

so what we have

node will added success, but afer - dataSource generate request to '/getnodes' and get it from database and render it to treeview
in result we have two same node in one brunch
please help to solve this problem

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 06 Dec 2012, 01:30 PM
Hello Evgen,

 
Our records shows that you downloaded the Kendo UI GPL and after a short time of period the Kendo UI Trial. Is this mean that you decided to not use the Kendo UI GPL anymore?

As to the question, I will need more information about the case. A working jsBin/jsFiddle demo, which replicates the issue will be great.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Evgen
Top achievements
Rank 1
answered on 06 Dec 2012, 03:48 PM
I use Kendo UI GPL, the trial version was downloaded to compare it with GPL version;

About more information about the case.
Just try append new node to selected node
$('#treeview').data('kendoTreeView').append({
      name: 'Some name'
  }, $('#treeview').select());

DataSource transport you can see above

All nodes we keep in database, so when we load page with treeview, we get nodes with AJAX request, also we get nodes with AJAX request from database after node append, in result we have min two identical nodes in one brunch

just try it
0
Georgi Krustev
Telerik team
answered on 07 Dec 2012, 01:14 PM
Hello Evgen,

There is no difference between Kendo UI Trial and Kendo UI GPL concerning the functionality of the widgets. The difference is described here. After you are using Kendo UI GPL, you will need to post your questions in Kendo StackOverflow forums, as the Kendo UI forums, now called Premium forums are dedicated only for trial users and paid customers.

As to your question, the append method is designed to add child node/s to parent node. It does not check whether the added item already exists. If you need such functionality, then you will need to implement it manually. If you have additional questions use the StackOverflow forums.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Evgen
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Evgen
Top achievements
Rank 1
Share this question
or