2016-10-10 169 views
0

有要求的场合,在那里要求做下拉框中编辑TinyMCE的中........编辑下拉

enter image description here

能将它可编辑选择框这种转换在自由软件以及MS Office产品

enter image description here

回答

0

Hopfully,我能够通过使用combobox在我的自定义按钮类型实现的结果。

setup: function (editor) { 
     editor.addButton('mybutton', function() { 
      var items= ["8", "9", "10", "11", "12", "14", "16", "18", "20", "22", "24", "26", "28", "36", "48", "72"] 
      return { 
        type: 'combobox', 
        autofocus: true, 
        label: 'FontSizes', 
        values: items, 
        onChange: function(e){ 
         console.log(this.value()); 
        } 
      } 
     } 
0

尝试这样的:

editor.addButton('mybutton', { 
    type: 'combobox', 
    icon: false, 
    text: 'FontSizes', 
    values: [{text: "8", value:"8"}, {text: "9", value:"9"}, {text: "10", value:"10"}, {text: "12", value:"12"}, {text: "14", value:"14"}, {text: "16", value:"16"}, {text: "18", value:"18"}], 
    onselect: function(e){ 
     console.log(this.value()); 
    } 
}); 

Demo

编辑:Demo加入