gpt4 book ai didi

javascript - Devextreme 实时更新菜单

转载 作者:行者123 更新时间:2023-12-03 03:54:12 28 4
gpt4 key购买 nike

我尝试使用 devextreme + jquery/我可以理解,我可以如何执行下一个功能我需要

$("#gridContainer").dxDataGrid({
dataSource: gridDataSource,
selection: {
mode: "multiple"
},
.
.
.
onSelectionChanged: function () {
console.log('Hoola!!');
var menu = $("#menu").dxMenu('instance');
disabledMenu = false;
menu.repaint();

}


var menuItems = [
{
text: "With checked",
icon: "preferences",
disabled: disabledMenu,

但这不起作用我怎样才能做到这一点?

最佳答案

禁用 dxMenu 项目的最简单方法是通过“items ”选项访问必要的项目。例如:

https://jsfiddle.net/fktfju1c/

$("#button").dxButton({
text: "Disable the 'DesktopLCD 21' item",
onClick: function () {
var menuInstance = $("#menu").dxMenu("instance");
menuInstance.option("items[2].items[1].disabled", true);
}
});

$("#menu").dxMenu({
dataSource: menuItems
});

关于javascript - Devextreme 实时更新菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45026741/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com