プロンプトに即興を使用しており、特定の条件で動的にボタンを追加したい。
state0: {
html: 'Do you want to apply changes?',
buttons: { YES: 1, NO: 0 },
focus: 1,
submit: function(e, v, m, f) {
if (v == 1) {
e.preventDefault();
$.prompt.goToState('state1');
return false;
}
$.prompt.close();
}
},
この状態では、特定の条件のために 3 つのボタンが必要
"NEWCONFIG", "YES", "NO"
です。別の条件では、2 つのボタンが必要です。"YES", "NO"