TreeViewTemplates

2 posts, 0 answers
  1. Gregor
    Gregor avatar
    17 posts
    Member since:
    May 2012

    Posted 29 May 2012 Link to this post

    If I have the following treeview template:-

    <script id="treeview-template" type="text/kendo-ui-template">
                                    # var id = item.id; #
                                    # var name = item.text; #                                                 
                                    # var parentId = item.parentId; # 
                                   
                                     #= item.parentid #
                                     # if (item.parentid == null) { #
                                         test
                                     # } #

                                   
                                    <span categoryId="#= id #" class="#= parentId #">#= name #</span>
                                    <input type="hidden" name="#= name #" value="#= id #" />
                            </script>

    Any way for me to disable the nodes where the parentId is null?

    I tried doing this without success:-
      # if (item.parentid == null) { #
      <span categoryId="#= id #" class="k-denied">#= name #</span>
    # } #
     
    Thanks
    Gregor

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    1824 posts
    Member since:
    Sep 2012

    Posted 31 May 2012 Link to this post

    Hi Gregor,

    I am not sure if I understand your scenario correctly, because by design the Kendo UI Treeview nodes can not be disabled. Could you please provide more details or better yet send a simple example, which illustrates your case?

     

    Regards,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!

Back to Top