is there a way to collapse all the panels of Kendo Panelbar, on an action?

前端 未结 3 940
灰色年华
灰色年华 2021-01-18 11:49

I am working on an app where i am adding panelbars (multiselection) using JSP Wrapper (which means no ID to each of the panels), and inside those have the grids.

The

3条回答
  •  难免孤独
    2021-01-18 12:26

    If the id of your PanelBar is panel, do:

    $("#panel").data("kendoPanelBar").collapse($("li", "#panelbar"));
    

    or

    var panelbar = $("#panelbar").data("kendoPanelBar");
    panelbar.collapse($("li", panelbar.element));
    

    i.e. we will collapse every li element under #panelbar.

    EDIT: If you want to remove the selection, add:

    $(".k-state-selected", panelbar.element).removeClass("k-state-selected");
    

提交回复
热议问题