Skip to main content

Popup

A sub namespace of Application, exclusive for popup operations

//accessing to application.popup methods
SW.Application.Popup.{methodName}

show

Description

This method can be used to create a popup with the specified entity and data.

Method(s)

1   function show(
2 dashboardTabs: DashboardTab[],
3 params: {
4 documentName?: DocumentName;
5 data?: any;
6 container?: DOMComponent;
7 width?: number;
8 height?: number;
9 enableScroll?: boolean;
10 title?: string;
11 openInFullScreen?: boolean;
12 hideTabContainer?: boolean;
13 hideSubHeader?: boolean;
14 closeOnOutsideClick?: boolean;
15 onClose?: Function;
16 buttonsConfiguration?: DashboardButtonsConfiguration;
17 } = {
18 width: 800,
19 height: 500,
20 closeOnOutsideClick: true
21 }
22 ): void
ParameterTypeRequiredDefaultsDescription
dashboardTabsDashboardTabtrueAn array of DashboardTabs
documentNameDocumentNamefalseDocument's name
dataanyfalseData to pass to the popup
containerDOMComponentfalseContainer component
widthnumberfalse800It sets the pop-up's width (pixels)
heightnumberfalse350It sets the pop-up's height (pixels)
enableScrollbooleanfalseTo enable scrolling in the pop-up
titlestringfalsePop-up's title
openInFullScreenbooleanfalsePop-up open in full screen
hideTabContainerbooleanfalseTo hide sub container
hideSubHeaderbooleanfalseTo hide sub header
closeOnOutsideClickbooleanfalsetrueClose pop by clicking outside the pop-up area
onCloseFunctionfalseAction/Behaviour to be implemented on closing the pop-up
buttonsConfigurationDashboardButtonsConfigurationfalseEnable configuration buttons

Basic Usage

SW.Application.Popup.show([{ Id: '63a12710-3dcd-4d99-85f4-1214d6a4d55e', Title: 'Info' }], 
{
documentName: SW.DocumentName.Job,
width: 500,
height: 200,
enableScroll: false,
title: 'Job',
openInFullScreen: false,
hideTabContainer: false,
hideSubHeader: true,
closeOnOutsideClick: false
}
);

Response

It will open a popup with the passed configuration.


showBulk

Description

This method can be used to generate a pop-up to allow editing in bulk.

Method(s)

1   function showBulk(documentName: DocumentName, dataGrid: dxDataGrid,
2 params: {
3 width?: number;
4 height?: number;
5 } = {
6 width: 800,
7 height: 500
8 }
9 ): void
ParameterTypeRequiredDefaultsDescription
documentNameDocumentNametrueDocument's name
dataGriddxDataGridtrueDataGrid component
widthnumberfalse800It sets the new pop-up's width (pixels)
heightnumberfalse500It sets the new pop-up's height (pixels)

Basic Usage

SW.Application.Popup.showBulk(SW.DocumentName.Employee, dataGrid);

Response

img


showCreate

Description

This method can be used to add an add button on top, which calls a creation pop-up styled by the entity passed as parameter.

Method(s)

1    function showCreate(documentName: DocumentName,
2 params: {
3 width?: number;
4 height?: number;
5 container?: HTMLElement;
6 } = {
7 width: 800,
8 height: 350
9 }
10 ): void
ParameterTypeRequiredDefaultsDescription
documentNameDocumentNametrueDocument's name
widthnumberfalse800It sets the new pop-up's width (pixels)
heightnumberfalse350It sets the new pop-up's height (pixels)
containerHTMLElementfalseContainer component

Basic Usage

SW.Application.Popup.showCreate(SW.DocumentName.Company);

Response

It will open a popup with the required field to create the document type passed.


showConfirmation

Description

This method can be used to create a new popup with Yes and No buttons. If Yes button is pressed it will return true, else, it will return false.

Method(s)

1   function showConfirmation(
2 params: {
3 title?: string;
4 text?: string;
5 trueButtonText?: string;
6 falseButtonText?: string;
7 width?: number;
8 height?: number;
9 } = {
10 width: 400,
11 height: 150
12 }
13 ): Promise<boolean>
ParameterTypeRequiredDefaultsDescription
titlestringfalsePopup title
textstringfalsePopup text
trueButtonTextstringfalseTrue button text
falseButtonTextstringfalseFalse button text
widthnumberfalse400It sets the new pop-up's width (pixels)
heightnumberfalse150It sets the new pop-up's height (pixels)

Basic Usage

SW.Application.Popup.showConfirmation(
params: {
title: 'Popup title',
text: 'Click one button',
trueButtonText: 'Yes button',
falseButtonText: 'No button',
width: 400,
height: 150
}
);

Response

img


showPreview

Description

This method can be used to create a preview popup styled by the entity passed as parameter.

Method(s)

1    function showPreview(documentName: DocumentName, documentId: string,
2 params: {
3 dataGrid?: dxDataGrid;
4 fieldName?: string;
5 width?: number;
6 height?: number;
7 onSave?: Function;
8 onClose?: Function;
9 } = {
10 width: 800,
11 height: 500
12 }
13 ): void
ParameterTypeRequiredDefaultsDescription
documentNameDocumentNametrueDocument's name
documentIdstringtrueDocument's id
dataGriddxDataGridfalseDataGrid component
fieldNamestringfalseField's name
widthnumberfalse800It sets the new pop-up's width (pixels)
heightnumberfalse500It sets the new pop-up's height (pixels)
onSavefunctionfalseAction/Behaviour to be implemented on saving the pop-up
onClosefunctionfalseAction/Behaviour to be implemented on closing the pop-up

Basic Usage

SW.Application.Popup.showPreview(SW.DocumentName.Client, "ClientId");

Response

It will open a preview popup styled by the documentName passed as parameter.


showPrompt

Description

This method can be used to create a new popup with Yes and No buttons and a textBox. If Yes button is pressed it will return the text written in the textBox, else, it will return null.

Method(s)

1   function showPromptPopup(
params: {
title?: string,
text?: string,
trueButtonText?: string,
falseButtonText?: string,
width?: number,
height?: number
} = {
width: 400,
height: 150
}
): Promise<string>;
ParameterTypeRequiredDefaultsDescription
titlestringfalsePopup title
textstringfalsePopup text
trueButtonTextstringfalseTrue button text
falseButtonTextstringfalseFalse button text
widthnumberfalse400It sets the new pop-up's width (pixels)
heightnumberfalse150It sets the new pop-up's height (pixels)

Basic Usage

SW.Application.Popup.showPromptPopup(
params: {
title: 'Popup title',
text: 'Click one button',
trueButtonText: 'Yes button',
falseButtonText: 'No button',
width: 400,
height: 150
}
);

Response

img


showSystemPreview

Description

This method can be used to open a preview popup styled by the documentName passed as parameter.

Method(s)

1    function showSystemPreview(documentName: DocumentName, documentId: string,
2 params: {
3 width?: number;
4 height?: number;
5 onClose?: Function;
6 } = {
7 width: 750,
8 height: 500
9 }
10 ): void
ParameterTypeRequiredDefaultsDescription
documentNameDocumentNametrueDocument's name
documentIdstringtrueDocument id
widthnumberfalse750It sets the new pop-up's width (pixels)
heightnumberfalse500It sets the new pop-up's height (pixels)
onClosefunctionfalseAction/Behaviour to be implemented on closing the pop-up when changes were made

Basic Usage

SW.Application.Popup.showSystemPreview(SW.DocumentName.Estimate, 'estimateId');

Response

It will open a preview popup styled by the documentName passed as parameter.