Windows
import {Window} from 'cx/widgets';Windows are overlays with headers, footers and special appearance.
<Button onClick={(e, {store}) => { store.set('$page.contact.visible', true)}}>Open</Button>
<Window
title="Contact"
visible={{ bind: "$page.contact.visible", defaultValue: false }}
center
style={{ width: '500px' }}
modal
draggable
closeOnEscape
>
<div style={{ padding: "20px" }} layout={{ type: LabelsLeftLayout, mod: 'stretch' }}>
<TextField label="Name" value-bind="$page.contact.name" style={{ width: '100%' }} tooltip="A Tooltip" />
<TextField label="Email" value-bind="$page.contact.email" style={{ width: '100%' }} />
<TextArea label="Message" value-bind="$page.contact.message" rows={10} style={{ width: '100%' }} />
<DateField label="Date" value-bind="$page.contact.date" />
</div>
<div putInto="footer" style={{ float: "right" }} ws>
<Button mod="primary">Submit</Button>
<Button
// this will cause the Window to close
dismiss
>
Cancel
</Button>
</div>
</Window>| Property | Description | Type |
|---|---|---|
backdrop | Set to | boolean |
center | Set to | boolean |
closable | Controls the close button visibility. Defaults to | boolean |
closeOnEscape | Set to | boolean |
header | Advanced Window header as a custom Cx component. See example. | object |
inline | Set to | boolean |
modal | Set to | boolean |
title | Text to be displayed in the header. | string |
animate | Set to | boolean |
autoFocus | Set to | boolean |
autoFocusFirstChild | Set to | boolean |
baseClass | Base CSS class to be applied to the field. Defaults to | string |
centerX | Set to | boolean |
centerY | Set to | boolean |
class | Additional CSS classes to be applied to the element. If an object is provided, all keys with a "truthy" value will be added to the CSS class list. | string/object |
containerStyle | Style to be applied to the overlay's container element. | string |
destroyDelay | Number of milliseconds to wait, before removing the element from the DOM. Used in combination with the | number |
dismissOnFocusOut | Set to | boolean |
dismissOnPopState | Set to | boolean |
draggable | Set to | boolean |
fixed | Set to | boolean |
focusable | Set to true to make the top level overlay element focusable. | boolean |
items | List of child elements. | array |
layout | Define an inner layout. | string/object |
mod | Appearance modifier. For example, | string/array |
onMove | A callback function which fires while the overlay is being moved around. | function |
onResize | A callback function which fires while the overlay is being resized. | function |
outerLayout | Defines the outer layout which wraps the widget. | widget |
pad | Set to | boolean |
plainText | Set to | boolean |
preserveWhitespace | Keep whitespace in text based children. Default is | boolean |
putInto | Used with outer layouts. Specifies the name of the content placeholder which should render the widget. | string |
resizable | Set to | boolean |
resizeWidth | resizeWidth | number |
style | Style object applied to the wrapper div. Used for setting the dimensions of the element. | string/object |
trimWhitespace | Remove all whitespace in text based children. Default is | boolean |
vdomKey | Key that will be used as the key when rendering the React component. | string |
visible | Visibility of the widget. Defaults to | boolean |
zIndex | zIndex | number |