Edit Grids and Grid Data explains grid control capabilities:
These features allow you to manage large data sets efficiently, and to customize grids in your views.
When editing is enabled:
The grid displays these toolbar icons:
Add new record – Creates a new grid row and allows you to add values for the new record.
Save – Saves the new record, and any existing record you are editing.
Revert – Cancels all editing and reverts the grid to the original state.
Select available values for enumerated fields in a drop-down list. Drop-down list below illustrates values for Work Request Status:
Use a pop-up dialog to select available values for fields that validate on another table:
Example: When you select a part of the multi-part foreign key, such as Room Code, the dialog displays values of parent keys, such as Building and Floor Code. When you select a value, the grid saves parent values as well.
To clone a record:
Click the Add New Record icon in the toolbar.
The grid opens a new row for editing, and copies all values from the selected record into the new record.
When export is enabled, the grid displays the Export to XLS icon in the toolbar. To transfer grid data to an Excel spreadsheet, click the icon to export:
Several features allow you to customize grids, set grid restrictions, create custom grid reports, and save these customizations for future use. Grid control saves all changes you make to filter or group data, as well as to sort, hide, show, or reorder columns, and restores these customizations automatically when you reopen the grid.
If you customize a grid, the grid toolbar displays the Clear icon. Click the icon to clear the custom configuration, and redisplay the grid's data.
Sample code below enables various features.
To enable editing for a grid view:
var grid = View.createControl({ editable: true, ... });
To mark some columns as read-only:
var grid = View.createControl({ editable: true, columns: [ { ... readOnly: true, ... } ], ... });
To define event listeners:
var grid = View.createControl({ editable: true, events: { ... beforeSave: function(records) { // records is an array of Ab.data.Record objects // each record has oldValues (before the change) and newValues (after the change) // each record has the isNew property }, afterSave: function() { // code } } ... });
To enable export to XLS:
var grid = View.createControl({ toolbar: { export: true }, ... });
To enable the column chooser and the grouping selector:
var grid = View.createControl({ toolbar: { columnChooser: true, grouping: true }, ... });
See also
Copyright © 1984-2019, ARCHIBUS, Inc. All rights reserved. |