有没有办法在一次动作中折叠Kendo Panelbar的所有面板? [英] is there a way to collapse all the panels of Kendo Panelbar, on an action?

查看:240
本文介绍了有没有办法在一次动作中折叠Kendo Panelbar的所有面板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,该应用程序使用JSP包装程序添加面板栏(多选)(这意味着每个面板都没有ID),并且其中具有网格.

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 grids are storing data specific to the selected person, who are displayed as list items(images) on the top of the page.

我想做的是,当用户将人的选择从当前选择的人更改为另一个人时,折叠kendo面板栏中的所有面板.这将有助于重新加载新人员的数据,因为当用户选择/扩展面板以查看数据时,我将捕获该事件并根据所选人员重新加载网格以提供新的数据源.

What I want to do is that when user changes the selection of person, from the current selected to another, collapse all the panels of the kendo panelbar. This would help in reloading the data of the new person, because when the user will select/expand the panel to see the data, i would catch the event and reload the grid with a new Datasource, based on the selected person.

我希望在这里有意义,但是我不确定如何折叠PanelBar的所有面板.

I hope I make sense here, but I am not sure how to collapse all the panels of the PanelBar.

有什么建议吗?

推荐答案

如果PanelBaridpanel,请执行以下操作:

If the id of your PanelBar is panel, do:

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

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

即我们将在#panelbar下的每个li元素中collapse.

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");

这篇关于有没有办法在一次动作中折叠Kendo Panelbar的所有面板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆