Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the EventBeforeSelect it is required to return a payload object with the setting "promptCursorChange" set to true. This will block the record selection and prompt the user with the Has Changes dialog.

The getExternalPopup method from the ExternalScreen class can be used to retrieve the ExternalScreen window object based on provided screenNamespace used when launching the External Screen Popup.

Example:

Code Block
titleEventBeforeSelect on DataGrid to display HasChanges Prompt
linenumberstrue
/**
* Method to execute before row selecting to display ExternalScreen hasChanges prompt 
* @param grid 
*/
export function onBeforeGridRowSelect(grid: akioma.swat.Grid) {
    const payload:any = {};
    const DocviewerExternalScreen = akioma.ExternalScreen.getExternalPopup('sDocViewerExternalWindow');
    const hasChangesExternal:boolean = DocviewerExternalScreen.akioma.swat.Root.getFirstChildByType('businessEntity').hasChanges();
        
    if(hasChangesExternal) {
        payload.promptCursorChange = true;
    }

    return payload;
}

...