我想创建一个带有子菜单的列表框,但我不知道如何制作子菜单 . 关于TinyMCE的文档很糟糕,所以这就是我在这里提出的问题 .
这是我的代码:
editor.addButton('OwnStyling', {
type: 'listbox',
text: 'Stylesheet',
icon: false,
onselect: function(e) {
editor.insertContent(this.value());
},
values: [
{text: 'Menu item 1', value: 'Some text 1'},
{text: 'Menu item 2', value: 'Some text 2'},
{text: 'Menu item 3', value: 'Some text 3'}
],
onPostRender: function() {
// Select the second item by default
}
});
在值的位置,我想用自己的值创建一个子项 . 谁知道怎么做?
谢谢!!
1 回答
尝试类似的东西
对我来说它适用于contextmenu但没有在listbox上试试!