Hiding the atlassian dialog buttons

How do I hide the cancel and submit button for the atlassian dialog? The ‘chrome:false’ in the atlassian.json doesn’t hide the buttons and AP.dialog.getButton(‘cancel’).hide() doesn’t work.

It would be helpful if you could give an answer.

Hi @FidaZubair ,

I think you can do all of the following should work from within the iframe of the dialog:

AP.dialog.getButton('submit').disable();
AP.dialog.getButton('submit').enable();
AP.dialog.getButton('submit').toggle();
AP.dialog.getButton('submit').hide();
AP.dialog.getButton('submit').show();
AP.dialog.getButton('submit').isEnabled();
AP.dialog.getButton('submit').isHidden();
AP.dialog.getButton('cancel').disable();  // EDIT: unavailable: ACJS-253
AP.dialog.getButton('cancel').enable();   // EDIT: unavailable: ACJS-253
AP.dialog.getButton('cancel').toggle();   // EDIT: unavailable: ACJS-253
AP.dialog.getButton('cancel').hide();     // EDIT: unavailable: ACJS-253
AP.dialog.getButton('cancel').show();     // EDIT: unavailable: ACJS-253
AP.dialog.getButton('cancel').isEnabled();
AP.dialog.getButton('cancel').isHidden();

EDIT: Are you observing something different?
EDIT: As @marc pointed out below, certain cancel button operations have been disabled.

Regards,
Dugald

See Modal dialog 'cancel' button cannot be disabled using AP.dialog.getButton('cancel').disable() - #8 by dmorrow

1 Like

In that case, how do we hide the cancel button ?

The problem is that recreating a similarly-looking dialog box without chrome is not easy, mostly because we don’t really control the iframe size. And the reason to hide the Cancel button is if you want just one button (Close) - the only way to do it right now is to hide the Cancel button and rename the Submit button into “Close”, because the Cancel button doesn’t look like a button and therefore doesn’t work when alone.