我正在使用 KendoPenel 显示一些数据,并希望在数据运行时扩展特定面板并更改其颜色有一些问题。
我可以选择面板并使用以下代码展开它:
function ExpandItemInPanelBar() {
var panelBar = $("#KendoPanel3").data("kendoPanelBar");
// I have set 0 in 'eq(0)' so it will expand first item you can change it as per your code
panelBar.select(panelBar.element.children("li").eq(2));
var item = panelBar.select();
panelBar.expand(item);
item.addClass('myClass')
}
.myClass
{
background-color: red;
}
但是,尽管item.addClass('myClass')似乎生效了,因为当我将鼠标悬停在调试器中的 item 元素上时,它具有“添加了 MyClass”类,但听起来它没有正确更改背景颜色。我是否需要做任何特别的事情才能使该特定更改生效?