Edit Grids and Grid Data

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.

Batch editing

When editing is enabled:

  1. Click any cell in the grid to begin editing.
  2. 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.

Enumerated field selector

Select available values for enumerated fields in a drop-down list. Drop-down list below illustrates values for Work Request Status:

Validated field selector

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.

Clone record

To clone a record:

  1. Click the checkbox to select the record you want to clone.
  2. 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.

  3. Change values in the record as required, then save the new record.

Export to XLS

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:

Other customizations

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.

API configuration

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

Grid Control 3.0 Overview

Copyright © 1984-2019, ARCHIBUS, Inc. All rights reserved.