Expand then select/open first sub-panel

3 posts, 0 answers
  1. Clint
    Clint avatar
    56 posts
    Member since:
    Feb 2011

    Posted 04 Sep 2014 Link to this post

    I'm expanding a panelbar based on text from another element, which is easy enough.

    var li = $("#panel").find("span.k-header:contains('" + _txt + "')").closest("li.k-item");
    $("#panel").data("kendoPanelBar").expand(li);

    Now, how do select/open the first child panel under it?
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 04 Sep 2014 Link to this post

    Hello Clint,


    You could retrieve the underlying items for the current one and again invoke the expand (or select) method.
    E.g.
    va pb = $("#panel").data("kendoPanelBar");
    var li = pb.wrapper.find("span.k-header:contains('" + _txt + "')").closest("li.k-item");
    var subitem = li.find(">.k-group>.k-item:first");
    pb.expand(li);
    pb.select(subitem);

    Have a great day!

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Clint
    Clint avatar
    56 posts
    Member since:
    Feb 2011

    Posted 04 Sep 2014 in reply to Dimiter Madjarov Link to this post

    Excellent!  Thanks.  I just couldn't quite get the syntax right.  I know it's not directly a kendoui question, more of a jquery question, but I appreciate the assistance!
Back to Top