如何在TinyMCE 4弹出窗口中创建此特定布局?

时间:2015-07-02 13:14:36

标签: javascript plugins tinymce

回到TinyMCE 3,编辑/添加弹出窗口真的很容易,因为它都是纯HTML。 现在完全不同了,我迷失在哪种类型的物品上。 我能够通过调试tinymce.jstable plugin来收集所有可能的类型,因为文档缺乏所有这些,对于如何构建布局及其项目没有任何帮助。

这将是可能的项目列表:

absolutelayout
button
buttongroup
checkbox
collection
colorbox
colorbutton
colorpicker
combobox
container
control
draghelper
elementpath
factory
fieldset
filepicker
fitlayout
flexlayout
floatpanel
flowlayout
form
formitem
gridlayout
iframe
keyboardnavigation
label
layout
listbox
menu
menubar
menubutton
menuitem
messagebox
movable
panel
panelbutton
path
radio
resizable
resizehandle
scrollable
selector
spacer
splitbutton
stacklayout
tabpanel
textbox
throbber
toolbar
tooltip
widget
window

现在,如果我想创建这样的布局:

(Label -> Input text -> Button)在一行中,我该怎么做?

我需要修改表格的插件以启用添加背景图片浏览的可能性,我们已经有了文件管理器,所以当我点击“浏览”按钮时,我会搜索图像并将其插入表格中。

有什么想法吗?提前谢谢。

1 个答案:

答案 0 :(得分:2)

我自己想出来,这有点容易。我张贴以防其他人需要它。

{
                        layout: 'flow',
                        name: 'align',
                        type: 'form',
                        direction: 'column',
                        items: [
                                {
                                    label: 'Background image',
                                    type: 'textbox',
                                    name: 'bgimage'                                 
                                },
                                {
                                    type: 'button',
                                    name: 'bgimage',
                                    icon: 'browse',                                 
                                }
                            ]

                    },