MODx.Window
Last updated Oct 11th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn moreMODx.Window¶
Extends: Ext.Window Key Features: Drag-and-drop functionality; connector functionality for saving.

A MODx.Window edits record data from a Grid or AJAX request. It includes a FormPanel; add form fields (and other components) to it. Saving submits the FormPanel and sends an AJAX request to your connector.
Unique Parameters¶
| Name | Description | Default |
|---|---|---|
| action | If baseParams is not set, will use this as the action to the controller. | |
| allowDrop | Whether or not to allow dropping of tree items onto the form fields. | 1 |
| baseParams | An object of parameters to send along with the window form on save. | {} |
| blankValues | If true, will reset the values of the form each time it is shown. | 0 |
| cancelBtnText | The text of the cancel button for the window. | Close (lexicon cancel) |
| fields | An array of fields for the form, similar to Ext.form.FormPanel’s fields definition. | [] |
| fileUpload | If true, the form will be built to accept files. | 0 |
| formFrame | Whether or not to add a ext-style frame to the window. | 1 |
| labelAlign | The alignment of the labels on the form. | top |
| labelWidth | The width, in pixels, of the labels on the form. | 100 |
| record | A JSON object of default values (in name: value format) to set to the form when first loading the window. | {} |
| saveBtnText | The text of the save button for the window. | Save |
| url | The URL of the connector to submit the window form to. |
Custom Events¶
| Name | Description |
|---|---|
| success | If the form submission returns a success response. |
| failure | If the form submission returns a failure response. |
| beforeSubmit | Before the form submits its values to the connector, but after validation passes. |
| updateWindow | After the window’s form values are updated from a record (setValues/reconfigure). |
Unique Functionality¶
Firing the submit method¶
submit() submits the Window’s form. The window closes on success by default; pass false to keep it open:
var w = Ext.getCmp('my-window-id');
w.submit(); /* submit and close the window on success (default) */
w.submit(false); /* submit but leave the window open */
setValues¶
Sets the form values of the window:
var w = Ext.getCmp('my-window-id');
w.setValues({
name: 'John'
,email: 'my@email.com'
});
reset¶
Empties (resets) all form fields:
var w = Ext.getCmp('my-window-id');
w.reset();
Hiding and Showing Fields¶
hideField / showField make form fields visible or hidden. Unlike MODx.FormPanel’s methods, these expect the field object, not its name:
var w = Ext.getCmp('my-window-id');
w.hideField(w.fp.getForm().findField('email'));
w.showField(w.fp.getForm().findField('comments'));
See Also¶
- MODExt MODx Object
- MODExt Tutorials
- MODx.combo.ComboBox
- MODx.Console
- MODx.FormPanel
- MODx.grid.Grid
- MODx.grid.LocalGrid
- MODx.msg
- MODx.tree.Tree
- MODx.Window
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$185 per month—let's make that $500!
Learn more










