2016-10-10 371 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加入