Editing
Editing
Features
Editing
Excel-Style editing
The MultiRow has built-in support for Excel-like, fast, in-cell editing.There is no need to add extra columns with 'Edit' buttons that switch between display and edit modes.
Users can start editing simply by typing into any cell. This is called 'quick-edit' mode.In this mode, the cursor keys finish the editing and the grid moves the selection.They can also start editing by pressing F2 or by clicking a cell twice.This is called 'full-edit' mode.In this mode, the cursor keys move the caret within the editor and the user must press the Enter, Tab, or Escape keys to finish editing.
You can disable editing at the grid or column levels using the isReadOnlyproperty of the grid or column objects.
Mobile Devices:Mobile devices use the double-click event to zoom in and out, and do not showa keyboard by default. To start editing a cell on mobile devices, simply clicka cell to select it, then click it again to indicate you want to start editing.
Automatic type Validation/Coercion:If the user types anything that is invalid for the column (e.g. "hello" for anumeric or date column), the edits won't be applied and the cell will keep itsoriginal value. Dates and times are parsed using the format assigned to thecolumn.
Checkboxes:By default (and unlike Excel), Boolean values are shown as checkboxes. Userscan change the checkbox values by clicking or by pressing the space bar.Checkboxes are easier to read and to edit than fields containing "TRUE" or"FALSE" strings.
Editing Mode:There are two modes for updating the data.By default, the update operation will be commit to the server once finishing editing.If the user wants to commit the update operation to datasource server, the Update, Delete or Create action url should be provided.And the corresponding codes used to update the datasource should be written in the corresponding action.The other mode is called BatchEdit. The user can update, create or remove multiple items.Once these modifications are confirmed, They could be commit to the data source only once.Now these modifications can be commit by the commit method of CollectionView in client side.The user can also commit them by sorting, paging or filtering behavior.
Here is a typical editable MultiRow:
Popup editing
Popup editing keeps the native editing enabled for quick Excel-like data entry, and adds an "Edit Detail" button to invoke a form where the user can edit the item details.
To see this in action, select an item on the grid and click the "Edit Detail" button above.This will bring up a form where users can edit the data for the currently selected item.
The detail form uses specialized input controls that take up more space but can make data entry easier in some cases. The form has "OK" and "Cancel" buttons that commit the changes or restore the original data. Both actions are accomplished with a single call to the CollectionView used as a data source for the grid.
Inline editing
If for some reason you don't like the Excel-style editing and prefer to add editing buttons to every row (typical of editable HTML tables), you can accomplish that using an ItemFormatter and a few controller methods.To get the binding column in the ItemFormatter event handler, please use the MultiRow's getBindingColumn function.
The grid below demonstrates this approach. The buttons in the cells call methods in the controller to perform the required actions: