【发布时间】:2013-12-22 20:23:07
【问题描述】:
我正在尝试编写一个 tinymce 插件,因此我查看了 http://www.tinymce.com/ 上的教程“创建插件”。插入和替换内容没问题,一切正常。
现在我想在更改列表框的值后自动更改文本框的值。例如,更改列表框元素后,应将活动元素的值写入上面的文本框。我怎样才能访问这个元素?
tinymce.PluginManager.add('myexample', function(editor, url) {
// Add a button that opens a window
editor.addButton('myexample',
{
text: 'Example',
onclick: function()
{
// Open window
editor.windowManager.open({
title: 'Example Plugin',
body: [
// Text
{type: 'textbox', name: 'title', label: 'Text', value: 'temp'},
// Listbox
{type: 'listbox', name: 'test', label: 'Ziel',
'values':
[
{text: 'Eins', value: '1'},
{text: 'Zwei', value: '2'}
],
onselect: function(v)
{
console.log(this.value());
// CHANGE THE VALUE OF THE TEXTBOX ...
// ????
}
}
],
onsubmit: function(e)
{
console.log(e.data.title, e.data.test);
}
});
}
});
});
【问题讨论】:
标签: javascript plugins tinymce