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

TreeView templates not applied when adding nodes?

10 Answers 316 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kyle
Top achievements
Rank 1
Kyle asked on 09 Apr 2012, 06:10 PM
I have a treeView that gets created with a template. Similar to:

        treeView = $("#treeView").kendoTreeView({
            dragAndDrop: true,
            select: onTreeViewSelect,
            dataSource: [
... datasource contain entries with id's and types.
            ],
            template: "#= item.text #<input type='hidden' class='data-id' value='#= item.id #' /><input type='hidden' class='data-type' value='#= item.type #' />"
        }).data("kendoTreeView");

This allows me to get the id and type of a node. This works great during initialization, however I also have a button that allows users to add new nodes to the tree.

The problem is that when I add a node to the tree via:

                                treeView.append({
                                    id: data,
                                    text: 'SomeText',
                                    type: 'organizationFolder',
                                    template: "#= item.text #<input type='hidden' class='data-id' value='#= item.id #' /><input type='hidden' class='data-type' value='#= item.type #' />"
                                }, selectedNode);

It does not get the template applied. (In the example posted, I also attempted to set the template explicitly in the node. I have tried it without as well and it still does not work).

Is this a known issue? Is there any workaround for this?

10 Answers, 1 is accepted

Sort by
0
Kyle
Top achievements
Rank 1
answered on 10 Apr 2012, 07:03 PM
Is there any updates on this? Is it a known issue with a fix in progress, or possibly a workaround?
0
Gary
Top achievements
Rank 1
answered on 11 Apr 2012, 11:42 PM
You're not alone... I'm experiencing the same behavior.
0
Alexander Valchev
Telerik team
answered on 12 Apr 2012, 12:43 PM
Hello guys,

I am afraid this functionality is not supported at the moment.
We will investigate this case in short terms and will consider it for future releases.

Greetings,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kyle
Top achievements
Rank 1
answered on 12 Apr 2012, 03:14 PM
I added an entry to uservoice for this issue.
http://kendo.uservoice.com/forums/127393-kendo-ui-feedback/suggestions/2762946-fix-templates-so-that-dynamic-entries-work-insert
0
Accepted
Alex Gyoshev
Telerik team
answered on 24 Apr 2012, 07:57 AM
Hello all,

The issue has been fixed in the 2012.1.423 internal build from yesterday.

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kyle
Top achievements
Rank 1
answered on 24 Apr 2012, 12:30 PM
Hey Alex,
If I understand correctly, if we have purchased a commercial license we get access to internal builds? Is there a specific page that we can navigate to, that lists the internal builds and what fixes are in them?

(I have not purchased Kendo UI yet, but I think this fix will be the one that lets it win the evaluation).

Thanks!
0
Alex Gyoshev
Telerik team
answered on 24 Apr 2012, 01:24 PM
Hello Kyle,

Here's a link to the release notes for the 2012.1.423 build. The listing of internal builds is available for paying customers only, but you get the idea. The builds are updated roughly every two weeks, but we supply builds on demand (i.e. if a build fixes a issue that you encounter, you won't have to wait until it gets published through the internal builds infrastructure).

All the best,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kyle
Top achievements
Rank 1
answered on 25 Apr 2012, 02:10 PM
Thank you, we purchased Kendo UI and verified that this works on the specified build!
0
Alfredo
Top achievements
Rank 1
answered on 17 Jan 2014, 07:45 PM
Alex,

 I would take the same topic, because I am having the same problem. I added concatenated tags along with the text, but when serializing to json, toJSON gives error. How do I use the template in append? 

Use the commercial version 2013.2.918 

 Grateful.
0
Alex Gyoshev
Telerik team
answered on 20 Jan 2014, 07:59 AM
Hello Alfredo,

Please provide the steps to reproduce the problem in the online demos, or a jsBin sample that shows the issue. Here is the basic treeview setup to get you started.

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Kyle
Top achievements
Rank 1
Answers by
Kyle
Top achievements
Rank 1
Gary
Top achievements
Rank 1
Alexander Valchev
Telerik team
Alex Gyoshev
Telerik team
Alfredo
Top achievements
Rank 1
Share this question
or