Class: DialogBase

Cadcorp.UI.DialogBase

new DialogBase(config)

Base class for dialogs. The dialog is enhanced by using the jQuery UI dialog widget
Parameters:
Name Type Description
config Object Configuration for this object. The config supplied directly extends the control

Members

alreadyOpen

Properties:
Name Type Description
alreadyOpen boolean If set to true, the dialog is already open

closeText

Properties:
Name Type Description
closeText string The text added to the close button

events

Properties:
Name Type Description
events Cadcorp.Util.Events The events object

footerId

Properties:
Name Type Attributes Description
footerId string <nullable>
The id of the footer element

(constant) HEIGHT_SPACER :number

Used to give a constant spacing between the top of a dialog and the top element on the screen
Type:
  • number

heightFactor

Properties:
Name Type Description
heightFactor number Used when calculating the height of the dialog

id

Properties:
Name Type Description
id string The id for this control

isMobileDevice

Properties:
Name Type Description
isMobileDevice boolean If set to true, the device this dialog is running on is a mobile device

(protected) m_content

Properties:
Name Type Description
m_content Object The jquery object that contains the content for this dialog

(protected) m_dialog

Properties:
Name Type Description
m_dialog Object The jquery object that is this dialog

(protected) m_errorDialog

Properties:
Name Type Description
m_errorDialog Cadcorp.UI.ErrorDialog The jquery dialog used to display any error for this dialog
Properties:
Name Type Attributes Description
m_menu Object <nullable>
The jquery object that is the menu
Properties:
Name Type Attributes Description
m_menuItem Object <nullable>
The jquery object that is the menu item

mapId

Properties:
Name Type Attributes Description
mapId string <nullable>
The id of the map this dialog is linked to
Properties:
Name Type Attributes Description
menuId string <nullable>
The id of the menu control
Properties:
Name Type Attributes Description
menuItemId string <nullable>
The id of the menu item control this dialog is triggered by
Properties:
Name Type Description
modal boolean If set to true, the dialog will have modal behavior; other items on the page will be disabled, i.e., cannot be interacted with. Modal dialogs create an overlay below the dialog but above other page elements.
Default Value:
  • false

prefix

Properties:
Name Type Description
prefix string The asp.net client id

stayOpen

Properties:
Name Type Description
stayOpen boolean If set to true, stops the dialog from closing

titleText

Properties:
Name Type Description
titleText string The title text for this dialog

Methods

(protected) calculateInitialWidth() → {number}

Calculates the initial width of the dialog. This can called before create.
Returns:
The width of the dialog in pixels
Type
number

(protected) calculateMaxHeight() → {number}

Calculates the height of the dialog. If menu and footerId are not null the height of these 2 elements is subtracted from the height so the dialog always fits on the page.
Returns:
The height of the dialog in pixels
Type
number

(protected) calculateWidth() → {number}

Calculates the width of the dialog. This method should only be called after create has been called.
Returns:
The width of the dialog in pixels
Type
number

create(userDialogConfig)

Creates the jQuery UI dialog. The userDialogConfig parameter is used to override the default options.
Parameters:
Name Type Description
userDialogConfig Object An object containing options for this dialog. Any valid option for the jQuery Ui Dialog widget can be supplied

destroy()

Destroys this dialog

(protected) getBottomPosition() → {Cadcorp.UI.DialogBase.Position}

Calculates the bottom position for this dialog. If footerId is not null the top of the footer is used to calculate the bottom position, otherwise the full height of the page is used.
Returns:
The bottom left coordinate of this dialog
Type
Cadcorp.UI.DialogBase.Position

(protected) getMenu() → {Cadcorp.UI.Menu}

Gets the menu object, if any, for this dialog
Returns:
The menu linked to this dialog
Type
Cadcorp.UI.Menu

(protected) getMenuHeight() → {number}

Gets the height of the linked menu in pixels. If menuId is null 0 is returned, otherwise the height of the menu.
Returns:
The height of the linked menu
Type
number

(protected) getSize() → {Cadcorp.UI.DialogBase.Size}

Gets the current size of this dialog.
Returns:
The size of the dialog
Type
Cadcorp.UI.DialogBase.Size

(protected) getTopPosition() → {Cadcorp.UI.DialogBase.Position}

Calculates the top position for this dialog. If menuId is not null the bottom of the menu is used to calculate the top position
Returns:
The top left coordinate of this dialog
Type
Cadcorp.UI.DialogBase.Position

hide()

Hides this dialog.

isOpen() → {boolean}

Determines if this dialog is open or not.
Returns:
True if the dialog is open, otherwise false
Type
boolean

(protected) resizeHandler()

Event handler for the window resize event

show()

Shows this dialog, creating it if required.

Type Definitions

Position

Describes the top left coordinate of an element
Type:
  • Object
Properties:
Name Type Description
top number The top position in pixels
left number The left position in pixels

Size

Describes the size of this dialog
Type:
  • Object
Properties:
Name Type Description
width number The width in pixels
height number The height in pixels

Events

beforeclose

Before close event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.DialogBase The sender of the event

close

Close event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.DialogBase The sender of the event

open

Open event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.DialogBase The sender of the event