2016-10-10 3 views

答えて

0

のように、私は私のカスタムボタンでタイプとして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

EDIT:追加のデモ

関連する問題