JSWolf:
For the differences between 2.1 and 2.0, see the
WhatsNewIn2_1_x wiki page.
Analogus:
To create a dialog on x50 models, you can use this code in a function:
Code:
var dialog = kbook.model.getConfirmationDialog();
dialog.onOk = function () {
// what to do if Ok/Yes is pressed
}
dialog.onNo = function () {
// what to do if No/Cancel is pressed
}
dialog.openDialog('Dialog text', 'As many lines as you want', 'three...', 'maybe four?', 0);
The last parameter given to openDialog determines the buttons (basically):
0 = Yes/No
1 = Ok
2 = no buttons, keys locked
3 = no buttons, keys working
4 = Cancel
There are more possibilities (see main.xml, search for CONFIRMATION_DIALOG_AREA), but these are the most useful. Dialogs have a few more properties and methods such as 'target' and 'closeDialog', but the above should cover most cases.