cpr.core.DialogManager

A class that manages dialogs.

Index

Methods
Name Return Type Description
activateDialogByName Activate with the name of the dialog.
closeAll Close all dialogs.
getActiveDialogName String Returns the name of the active dialog.
getConstraintByName {[key:string]: Number} Returns the dialog's Constraint.
getDialogByName Dialog Returns the name of the dialog as a dialog.
getDialogName String Returns the name through the dialog.
getDialogNames String[] Returns the dialog names.
minimizeAll Collapses all dialogs.
openDialog Promise<Object> Open a dialog in the app.
replaceConstraintByName Boolean Replace the dialog's Constraint.
restoreAll Restore all dialogs.
sort Sort the dialog.
sortInCascade Arrange the dialogs in a cascade pattern.
sortInTile Arrange the dialog in tile form.
updateConstraintByName Boolean Change the dialog's Constraint.

Constructor

DialogManager(appInstance)
Parameters
name type description
appInstance AppInstance

Methods

activateDialogByName(dialogName)
Activate with the name of the dialog.
Parameters
name type description
dialogName String Dialog name
closeAll()
Close all dialogs.
getActiveDialogName()
Returns the name of the active dialog.
return String
getConstraintByName(dialogName)
Returns the dialog's Constraint.
Parameters
name type description
dialogName String
return {[key:string]: Number}
getDialogByName(name)
Returns the name of the dialog as a dialog.
Parameters
name type description
name String
return Dialog
getDialogName(dialog)
Returns the name through the dialog.
Parameters
name type description
dialog Dialog Dialog object
return String
getDialogNames()
Returns the dialog names.
return String[]
minimizeAll()
Collapses all dialogs.
openDialog(appId, dialogName, dialogProperties, handler)
Open a dialog in the app. If there is no value for the constraint, it is set to the default value. If the name attribute is the same as the existing dialog, the page of the existing dialog is changed. If different, a new dialog opens.
dialogManager.openDialog("dlgs/people","dialogName1");
dialogManager.openDialog("dlgs/people","dialogName2",{width:400,height:300});
dialogManager.openDialog("dlgs/people","dialogName3",{top:30,right:20,width:400,height:600});
dialogManager.openDialog("dlgs/people","dialogName4",{width:400, height:300},function(dialog){
// Process when the dialog is loaded dialog.modal = false; dialog.headerMin = true; }).then(function(returnValue){ //Processing the value returned when closing });
Parameters
name type description
appId #app | cpr.core.App The ID of the app to open
dialogName String The name of the dialog. If the value is null, a value is automatically generated.
dialogPropertiesoptional DialogProperties Dialog position and size.
handleroptional (dlg: cpr.controls.Dialog)=>Void If you need to handle the Dialog object more specifically, you can add handlers to handle the Dialog (you can add event handlers, change styles, etc.)
return Promise<Object>
replaceConstraintByName(dialogName, newConstraint)
Replace the dialog's Constraint. The parameter is changed to Constraint.
Parameters
name type description
dialogName String Dialog name
newConstraint DialogConstraint Replaceable constraint
return Boolean
restoreAll()
Restore all dialogs.
sort(type, prop)
deprecatedDialog sorting has been separated by type. Use sortInCascade, sortInTile.
Sort the dialog.
dialogManager.sort (cpr.core.DialogSortType.cascade);
dialogManager.sort ("tile", {horizontalMargin: 10, verticalMargin: 10, horizontalSpacing: 10, verticalSpacing: 10});
 
Parameters
name type description
type DialogSortType Sort type of dialog.
propoptional DialogSortProperty Sorting properties.
sortInCascade(options)
Arrange the dialogs in a cascade pattern.
dialogManager.sortInCascade();
dialogManager.sortInCascade({horizontalMargin:10,verticalMargin:0,horizontalSpacing:30,verticalSpacing:30});
Parameters
name type description
optionsoptional DialogCascadeSortOptions Sorting options.
sortInTile(options)
Arrange the dialog in tile form.
dialogManager.sortInTile();
dialogManager.sortInTile({horizontalMargin:10,verticalMargin:10,horizontalSpacing:10,verticalSpacing:10});
Parameters
name type description
optionsoptional DialogTileSortOptions Sorting options.
updateConstraintByName(dialogName, overridingConstraint)
Change the dialog's Constraint.
Parameters
name type description
dialogName String
overridingConstraint DialogConstraint
return Boolean