简体   繁体   English

如何在windowmanager中添加tinymce列表框值

[英]how to add tinymce listbox values in windowmanager

I open up a windowmanager and add a textfield and listbox: 我打开一个windowmanager并添加一个textfield和listbox:

editor.windowManager.open({
    title: 'Insert caption',
    body: [
        {type: 'textbox', name: 'text', label: 'text', 'multiline': 'true', 'minWidth': 450, 'minHeight': 100},
        {type: 'listbox', name: 'align', label: 'align', 'values': ['pull-left','pull-right']}
    ],

The listbox is displayed, but not the values. 将显示列表框,但不显示值。 In the documentation ( http://www.tinymce.com/wiki.php/api4:class.tinymce.ui.ListBox ) it states: "Array with values to add to list box." 在文档( http://www.tinymce.com/wiki.php/api4:class.tinymce.ui.ListBox )中,它声明:“具有要添加到列表框的值的数组。”

What am I doing wrong? 我究竟做错了什么?

I found out while searching in the official TinyMCE plugins. 我在官方的TinyMCE插件中搜索时发现了。 So this is how it's done: 所以这就是它的完成方式:

{type: 'listbox', 
    name: 'align', 
    label: 'align', 
    'values': [
        {text: 'Left', value: 'left'},
        {text: 'Right', value: 'right'},
        {text: 'Center', value: 'center'}
    ]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM