javascript - How to have KendoPanel's all the sections expand -
i started using kendopanel , wanting expand segments of panel under condition. using following code achieve that:
var panelbar = $("#kendopanel").kendopanelbar(); var kendopanelbar = panelbar.data().kendopanelbar; kendopanelbar.collapse($("li", panelbar.element));
seems contracting segments instead of expanding them. doing wrong?
please try below code snippet.
<ul id="mypanelbar"> <li class="k-state-active">first item <ul> <li>sub item 1</li> <li>sub item 2</li> <li>sub item 3</li> <li>sub item 4</li> </ul> </li> <li>second item <ul> <li>sub item 1</li> <li>sub item 2</li> <li>sub item 3</li> <li>sub item 4</li> </ul> </li> <li>third item <ul> <li>sub item 1</li> <li>sub item 2</li> <li>sub item 3</li> <li>sub item 4</li> </ul> </li> <li>fourth item <ul> <li>sub item 1</li> <li>sub item 2</li> <li>sub item 3</li> <li>sub item 4</li> </ul> </li> <li>fifth item <ul> <li>sub item 1</li> <li>sub item 2</li> <li>sub item 3</li> <li>sub item 4</li> </ul> </li> </ul> <script> var panelbar; $(document).ready(function () { panelbar = $("#mypanelbar").kendopanelbar().data("kendopanelbar"); // expand item panelbar.expand($("#mypanelbar li.k-item")); }); </script>
let me know if concern.
Comments
Post a Comment