Edit

CreateListWindow (id, recordFormID, table, search, headingString, columnsString [, modes [, properties] ])

Definition:  A variant of CreateWindow for displaying a list of records much like the built-in MoneyWorks list windows.

The window's first control (object #1) should be a list object. It will be replaced with a record list for the requested database table named by the table parameter. The list will be filtered according to the search string.

If recordFormID is not the empty string, then double-clicking a record will automatically instantiate an instance of that window with appropriate record locking so that you can read and (for allowable tables) write records safely (see ReadCurrentRecordForWindow and WriteCurrentRecordForWindow).

The headingString is a tab-delimited list of column headings. Each column heading may optionally be followed by specifiers for the column width; and the column alignment. These specifiers are separated by vertical bar characters (|).

headingString = Heading_Text | width * | alignment

The * after the width is optional and denotes that the column will resize if the columns widths do not add up to the list width. Default is 80 and the first column is the resizable one by default.

Alignment can be one of 'L', 'C', 'R' for left, centre or right alignment. Default is left.

Examples:

"My Heading" — a left aligned cell (by default, 80 points wide)

"My Heading|100" — 100 points wide column

"My Heading|80|R" — right-aligned column

The columnsString is a tab-delimited list of custom column calculations that may reference the field names for the database table.

The optional modes can specify behaviour of the list. This is a bitfield which can include a combination of the following constants added together: fListMode_Selectable, fListMode_OnlyOne, fListMode_DoubleclickAccept, fListMode_DoubleclickItemHit, fListMode_ToggleSelection. If it is omitted, selectable is on my default.

In v9 and later, you can provide an optional properties associative array which will be used to initialise the properties of the window (that you would otherwise set and get with SetWindowProperty and GetWindowProperty. This removes the need to use global properties to pass parameters to window handlers. Note that to provide properties this way you must also provide a modes parameter (use 0 if you don't need special modes).

Availability:  available within MWScript handlers.

See Also:

CreateWindow: Instantiate a modeless custom window

GetWindowProperty: Retrieve data previously stored for a windowHandle

ModalJobsheetEntryWindow: Run a modal Jobsheet entry modify/create window

ModalListWindow: Instantiate a modal custom database table list window

ModalTransactionWindow: Run a modal transaction modify/create window

ModalWindow: Instantiate a modal custom window

ReadCurrentRecordForWindow: Load a record in custom UI, or tagged fields in standard UI

SetWindowProperty: Store data related to a window

WriteCurrentRecordForWindow: Save a record in custom UI, or save tagged fields in standard UI