I am using impromptu for prompt and I want to add buttons dynamically on specific condition.
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();
}
},
In this state I need 3 buttons for particular condition:
"NEWCONFIG", "YES", "NO"
; and for another condition I need 2 buttons: "YES", "NO"
Define a button variable before initializing your
impromptu
as belowthen initialize
impromptu
That's it.. Let me know if any problem!!