Lattice Grid Buy a licence

developer guide

Editing: JavaScript Data Grid Guide

Inline and row editing, validation, optimistic writes with rollback, cell ranges, the fill handle, and formulas typed into a cell.

Developer guide › Editing

Editing

Turning it on

Optimistic writes and rollback

The grid has always written optimistically without calling it that: an edit lands in the model and is painted before anything else happens. What edit.commit adds is durability: whether the write reached your server, and what to put back when it did not.

Selection and ranges

Row selection and cell ranges are separate answers to separate questions, which records versus which values. Dragging across cells does not tick row checkboxes, and selecting rows does not build a range.

Filling a series

Dragging the fill handle continues what it can recognise rather than repeating the block. Detection is per column, so dragging three columns down continues three independent series.

Formulas

A leading = in a numeric cell is a formula. Type =quantity * unitPrice and the grid stores 119.88.

Your own menu items and buttons

The cell menu's function form is handed the cell that was clicked and the built-in items. Adding one entry does not mean reproducing the other thirteen.

Row reorder

rowReorder: true puts a drag handle in the first visible column and lets a user move rows with it, or with Alt+Shift+↑/↓. { column: 'name' } puts the handle somewhere else.

Moving rows between grids

A row can be dragged out of one grid and into another, a picker beside a basket, an inbox beside a queue, an available list beside an assigned one.

Editing a row on a form

Double-clicking a row opens it in a panel (a right-hand drawer or a centred dialog) with one control per field, a Save and a Cancel. It is the shape almost every application built on a grid ends up wanting, and until now the shape they had to build themselves.