how to add tinymce listbox values in windowmanager

梦想与她 提交于 2019-12-01 15:48:55

问题


I open up a windowmanager and add a textfield and 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."

What am I doing wrong?


回答1:


I found out while searching in the official TinyMCE plugins. 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'}
    ]
}


来源:https://stackoverflow.com/questions/18602764/how-to-add-tinymce-listbox-values-in-windowmanager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!