Due to a ransomware attack, the wiki was reverted to a July 2022 version. . We apologize for the lack of a more recent valid backup.
...
The following dialog box might have code structured as listed below:
A More Complete Example
| Code Block | ||||
|---|---|---|---|---|
| ||||
// ds is a reference to the DialogService.
var dialogId = 'app-dialog',
dialogOpts = {
edge: 'right'
};
function createConfirmationText(action, itemId) {
var content = ds.createDiv();
content.append('p').text(action + ' ' + itemId);
return content;
}
function confirmAction(action) {
var itemId = $scope.selId,
spar = $scope.sortParams;
function dOk() {
$log.debug('Initiating', action, 'of', itemId);
wss.sendEvent(appMgmtReq, {
action: action,
name: siditemId,
sortCol: spar.sortCol,
sortDir: spar.sortDir
});
}
function dCancel() {
$log.debug('Canceling', action, 'of', itemId);
}
ds.openDialog(dialogId, dialogOpts)
.setTitle('Confirm Action')
.addContent(createConfirmationText(action, itemId))
.addButton('OK', dOk)
.addButton('Cancel', dCancel);
}
// e.g. confirmAction('activate');
// $scope.selId contains the ID of the selected item |