我做了一个插件,我需要一个有2个下拉菜单的弹出窗口 .

第二个是第一个 .

我怎样才能做到这一点?在创建列表框选项后,我无法找到操作/更新列表框选项的方法 .

码:

selectField: function() {
var listbox;

plugin.getForms().then(function(comboboxValues) {
    editor.windowManager.open({
        title: "Field name",
        width: 780,
        height: 140,
        body: [
            { type: "listbox", name: "form", size: 40, autofocus: true, text: "Select your form", values: comboboxValues, onselect: plugin.fillFields },
            { type: "listbox", name: "field", size: 40, values: [{text: "test", value: 1}] }
        ],
        onsubmit: function(e) {
            editor.insertContent("[mytag field=\"" + e.data.fieldName + "\"]");
        },
        onPostRender: function() {
            listbox = this;
            console.log(listbox);
        }
    });
});

}

我试过了:How can I manipulate TinyMCE listbox elements?

更改操作listbox.settings.values和listbox.repaint

操作字段数组并重新绘制

还有更多 .

两者都不起作用