我尝试使用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,
但这不起作用 我怎么能这样做?
答案 0 :(得分:1)
禁用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
});