다음을 통해 공유


Features of the JS Grid Control

Applies to: SharePoint Foundation 2010

Each cell in the JS Grid control supports its own style-based behavior.

Features of the JS Grid Control

The JS Grid control supports the following features:

  • Asynchronous validation

  • Copy and paste operations

  • Exporting to Microsoft Excel

  • Display and edit controls

  • Fill-down operations

  • Precedence

  • Multiple views: Grid, Gantt and Grid, and Pivoted

  • Undo and redo operations

  • Widgets

Asynchronous Validation

Errors from the server need to be displayed so that the user can correct them. The asynchronous nature of most grid implementations complicates this process. As an example, the user can make a change that is not valid, and then scroll that change out of view before the server returns an error. Or the user can make several changes that are not valid and that require separate attention (for example, by using fill-down operations or copy and paste operations).

In the Microsoft Project implementation of the JS Grid control, validation messages work in tandem with the status bar to tell the user what to do. As errors are returned by the server, the status bar keeps a running total and enables the user to navigate among the errors.

The JS Grid control performs data type error checking. When the user enters information that does not conform to the declared data type of the column, a red box appears around the cell and a red error indicator appears on the corresponding row. This behavior is provided by the JS Grid control.

Copy and Paste

Copy and paste operations from Excel are supported.

Edit Mode Status

The user can type directly in a grid cell if the edit mode of the cell permits. The JS Grid control EditMode enumeration (see Table 1) specifies whether the cells contained in a record or file should allow editing.

Table 1. EditMode values

Value

Description

Defer

Always defer read/write status; the control has no control over its own state.

ReadOnly

If applied to a record or field, none of the cells are editable; if applied to a row, check the edit mode of each cell.

ReadOnlyDefer

The cell is read-only unless settings on the row, column, or grid control specify otherwise. If applied to a row, check the edit mode of each cell.

ReadWrite

The cell is editable, unless settings on the row, column, or grid control specify otherwise.

ReadWriteDefer

The cell is editable, unless settings on the row, column, or grid control specify otherwise.

Export to Excel

If paged, the JS Grid control requests all pages of data from the server to the client.

The update status indicator displays the message Preparing data for export. When the data is in memory, the control transforms the dataset to worksheet XML by using the Project Server logic.

Fill-down Operations

Fill-down operations are supported.

Precedence

The order of precedence is cell, row, column, and then grid.

Text Direction

The JS Grid control and the JS Grid control Gantt chart support right-to-left (RTL) languages.

The TextDirection property works with the locale ID (LCID) property to deliver a regionally appropriate grid or Gantt chart. Setting LCID for the control passes the indicated LCID to the grid panes. The grid pane passes the LCID to the columns.

gf.EditMode = TextDirection.RightToLeft;

Note

Date columns are an exception to this behavior: A date column displays the dates and date picker formatted for the input LCID.

Undo and Redo

The JS Grid control supports 20 levels of undo. Undo and redo track changes and the original value. Undo (CTRL+Z) reverses the last change on the undo stack by applying the original value. Redo (CTRL+Y) reapplies the last change that was undone.

The control accepts no mouse input for undo or redo operations. If undo and redo operations are required, the page that contains the grid must provide the functionality.

The grid exposes two methods to manage undo and redo operations:

  • undoLastAction   Undoes the last change. If the undo stack is empty, undoLastAction returns 0; otherwise it returns the number of undo actions remaining.

  • redoLastAction   Redoes the last change. If the redo stack is empty, redoLastAction returns 0; otherwise it returns the number of redo actions remaining.

Widget Controls

The JS Grid control supports data validation by using a widget framework and infrastructure.

Widgets can be complex controls. Developers can build their own widget controls and include their own icons and click actions.

For more information about JS Grid control widget controls, see JS Grid Control Widgets.

See Also

Reference

GridSerializer

Concepts

Client Object Model Distribution and Deployment

Differences Between Managed and JavaScript Object Models

Other Resources

Locale ID (LCID) Chart