Window FAQ: Window With OK-Cancel Buttons

Posted By Vitaliy | March 21, 2012 | ExtJS 4.0.7
0 2196
Config option "buttons" used for adding buttons docked to the bottom of the window.

Js Code

Ext.widget('window', {
	title: 'Test Window',
	width: 300,
	height: 200,
	autoShow: true,
	buttons: [
		{
			text: 'OK',
			handler: function () {
				Ext.Msg.alert('Info', 'Button OK was clicked!', function () {
					this.up('window').close();
				}, this);
			}
		},
		{
			text: 'Cancel',
			handler: function () {
				this.up('window').close();
			}
		}
	]
});