Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add tinymce listbox values in windowmanager

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?

like image 916
jonazu Avatar asked Sep 03 '13 22:09

jonazu


1 Answers

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'}
    ]
}
like image 179
jonazu Avatar answered Oct 08 '22 12:10

jonazu