The Ext.Window class in Ext JS has several attributes that can be used to customize its behavior and appearance. Here are some commonly used attributes and their usages:
title: Specifies the title text displayed in the window’s header. It can be set using thetitleattribute during window instantiation or by calling thesetTitle()method.widthandheight: Determines the initial width and height of the window in pixels. These attributes can be set during instantiation or modified using thesetWidth()andsetHeight()methods.resizable: A boolean attribute that allows the user to resize the window. Set it totrueto enable resizing, andfalseto disable it. It can be set during instantiation or modified using thesetResizable()method.draggable: A boolean attribute that enables or disables dragging the window. When set totrue, the user can move the window by dragging its title bar. It can be set during instantiation or modified using thesetDraggable()method.modal: A boolean attribute that determines whether the window should be displayed as a modal window. When set totrue, the window will block user interaction with the rest of the application. It can be set during instantiation or modified using thesetModal()method.layout: Specifies the layout to be used within the window for arranging its content. Common layouts includeborder,hbox,vbox, andfit. It can be set during instantiation or modified using thesetLayout()method.closable: A boolean attribute that controls whether the window can be closed by the user. When set totrue, a close button will be displayed in the window’s header. It can be set during instantiation or modified using thesetClosable()method.maximizableandminimizable: Boolean attributes that determine whether the window can be maximized or minimized, respectively. Set them totrueto enable the corresponding functionality. They can be set during instantiation or modified using thesetMaximizable()andsetMinimizable()methods.items: Specifies the content to be placed inside the window. It can be any Ext JS component, such as a form, grid, or panel. Theitemsattribute accepts an array of components or a single component instance.listeners: Allows you to define event listeners to handle various events triggered by the window, such as ‘beforeclose’, ‘resize’, ‘dragstart’, and more. You can define listeners as an object with event names as keys and function references as values.
Example:
new Ext.Window({
title: 'Select Options',
layout: 'form',
width: 460,
height: 125,
items: [selectField],
buttons: [submitButton, Cancel],
closable: false,
scrollable: true,
modal: true,
centered: true
});