Guide applies to: modern
Dialog
A dialog is a type of floating panel. Like any component, it has a tpl property, whose data is provided by either the data config or by running setData(), without being restricted by the comparable restrictive issues of pop-up alert windows. Take note of the show() method to make it display.
Expand Code
JS Run
Ext.define('MyApp.view.Dialog', {
extend: 'Ext.Dialog',
xtype: 'dialog',
title: 'Dialog',
tpl: '<h2>{message}</h2>',
bodyPadding: 8,
height: 300,
width: 300
});
Ext.define('MyApp.view.Main', {
extend: 'Ext.Panel',
tbar: [{
xtype: 'button',
text: 'Create',
handler: function(button) {´
button.up('panel').add({
xtype: 'dialog',
data: {
message: 'Hi there!'
}
}).show();
}
}]
});
Ext.application({
name: 'MyApp',
mainView: 'MyApp.view.Main'
});