TreeView value - jquery help

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

    Posted 28 May 2012 Link to this post

    I have my treeview output as below:-

    <div class=​"k-mid">​
    <span class=​"k-icon k-plus">​</span>​
    <span class=​"k-in k-state-hover">​
    <span categoryId="11">​TestNameHere</span>​
    </span>​
    </div>​

    When I select a node from the treeview I can alert(treeview.text(e.node)) to get the text - but I need access to the categoryId value, anyone know how I can get this?

    Thanks
  2. Chris
    Chris avatar
    38 posts
    Member since:
    Feb 2012

    Posted 29 May 2012 Link to this post

    Have you tried $(e.node).attr('categoryId')?
  3. Gregor
    Gregor avatar
    17 posts
    Member since:
    May 2012

    Posted 29 May 2012 Link to this post

    Managed to get it working by doing this:- var selectedCatId = $(e.node.children[0]).find("input").val();

Back to Top