Documentation

Button click processing

By default, any clicked button closes dialog. When a handler is assigned for the button, dialog behaviour depends on the returned value:

  • true — dialog closes.
  • false — blocking ("disabled") is removed from the button, dialog remains open.
  • undefined (void) — no automatic actions performed, dialog closing and disabling removal must be performed manually.
  • Promise — button switches to "loading" status. Resolved promise ("resolve") closes the dialog, rejected promise (reject) returns button to the initial state.
BX.UI.Dialogs.MessageBox.alert("Message", (messageBox, button, event) => 
{
    messageBox.close();
}
);

Handler arguments are the following:

  • messageBox — dialog object (class instance BX.UI.Dialogs.MessageBox).
  • button — button object (class instance BX.UI.Button).
  • event — click event object (MouseEvent).
© «Bitrix24», 2001-2024
Up