ConfirmationBar
This widget is a Toolbar with default buttons for items common to system dialogs. Button order
is appropriate for the platform. For example, on Windows, OK/Cancel buttons are presented in that order, while on
Mac OS X and many flavors of Linux, these buttons are presented in Cancel/OK order.
//<code-header>
fiddle.title = 'Confirmation bar';
//</code-header>
new Panel({
appendTo : targetElement,
title : 'Confirmation Bar',
style : {
boxShadow : 'var(--b-elevation-1)',
borderRadius : 'var(--b-widget-border-radius-large)'
},
bbar : {
type : 'confirmationbar'
}
});Configs
98
Configs
98Common
Other
The name of the default button. Must match with the defaults in namedItems.
ok,cancelIn addition to normal form of items, this class supports a comma-delimited string.
For example:
items : 'ok,cancel',
// or
items : 'yes,no',
These are equivalent to:
items : {
ok : true,
cancel : true
},
// or
items : {
yes : true,
no : true
},
Both forms use the pre-defined buttons: 'cancel', 'ok', 'no', 'yes'.
{"Enter":"doDefault","NumpadEnter":"doDefault","Escape":"doCancel"}The default buttons available for use in the items config.
Set to false to disable synchronizing button widths. By default, buttons are assigned a minWidth based
on the longest text. The default OK and Cancel buttons (in the en-US locale)
will be assigned minWidth = '6em'.
CSS
DOM
Float & align
Layout
misc
Misc
Scrolling
Properties
92
Properties
92Class hierarchy
Other
Returns the cancel button if present in the items config or null if not present.
The name of the default button. Must match with the defaults in namedItems.
Returns the no button if present in the items config or null if not present.
Returns the ok button if present in the items config or null if not present.
Set to false to disable synchronizing button widths. By default, buttons are assigned a minWidth based
on the longest text. The default OK and Cancel buttons (in the en-US locale)
will be assigned minWidth = '6em'.
Returns the yes button if present in the items config or null if not present.
Content
CSS
DOM
Layout
Misc
Widget hierarchy
Functions
67
Functions
67Configuration
Events
Misc
Other
Widget hierarchy
Events
20
Events
20This event is fired when the user clicks one of the buttons.
// Adding a listener using the "on" method
confirmationBar.on('choice', ({ choice, relatedEvent, source, userAction }) => {
});| Parameter | Type | Description |
|---|---|---|
choice | ConfirmationBarChoice | The description of the chosen button. |
relatedEvent | Event | The DOM event. |
source | ConfirmationBar | The |
userAction | Boolean |
|
Event handlers
20
Event handlers
20This event is called when the user clicks one of the buttons.
new ConfirmationBar({
onChoice({ choice, relatedEvent, source, userAction }) {
}
});| Parameter | Type | Description |
|---|---|---|
choice | ConfirmationBarChoice | The description of the chosen button. |
relatedEvent | Event | The DOM event. |
source | ConfirmationBar | The |
userAction | Boolean |
|
Typedefs
8
Typedefs
8A description of the chosen button in a ConfirmationBar.
| Parameter | Type | Description |
|---|---|---|
name | ok | cancel | no | yes | The name of the chosen button. |
approve | Boolean | Set to |
ok | Boolean | Set to |
cancel | Boolean | Set to |
no | Boolean | Set to |
yes | Boolean | Set to |