TreeView templates not applied when adding nodes?

11 posts, 1 answers
  1. Kyle
    Kyle avatar
    45 posts
    Member since:
    Mar 2012

    Posted 09 Apr 2012 Link to this post

    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?
  2. Kyle
    Kyle avatar
    45 posts
    Member since:
    Mar 2012

    Posted 10 Apr 2012 Link to this post

    Is there any updates on this? Is it a known issue with a fix in progress, or possibly a workaround?
  3. Gary
    Gary avatar
    14 posts
    Member since:
    Jan 2012

    Posted 11 Apr 2012 Link to this post

    You're not alone... I'm experiencing the same behavior.
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 12 Apr 2012 Link to this post

    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!
  5. Kyle
    Kyle avatar
    45 posts
    Member since:
    Mar 2012

    Posted 12 Apr 2012 Link to this post

    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
  6. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2527 posts

    Posted 24 Apr 2012 Link to this post

    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!
  7. Kyle
    Kyle avatar
    45 posts
    Member since:
    Mar 2012

    Posted 24 Apr 2012 Link to this post

    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!
  8. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2527 posts

    Posted 24 Apr 2012 Link to this post

    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!
  9. Kyle
    Kyle avatar
    45 posts
    Member since:
    Mar 2012

    Posted 25 Apr 2012 Link to this post

    Thank you, we purchased Kendo UI and verified that this works on the specified build!
  10. Alfredo
    Alfredo avatar
    3 posts
    Member since:
    Nov 2013

    Posted 17 Jan 2014 Link to this post

    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.
  11. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2527 posts

    Posted 20 Jan 2014 Link to this post

    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!
Back to Top