Cell Editing
To setup cell editing set the cellEditable flag on the grid
and specify editor widget configurations for all editable columns.
If some of the cells should not be editable, disable editing using the editable property.
Use the onCellEdited callback to react on changes, e.g. update the record in the database.
For grids with many records it is recommended to use buffering for optimal performance.
| # | Name | Continent | Browser | OS | Visits |
|---|---|---|---|---|---|
| 0 | Jorge King | Europe | Firefox | Android | 90 |
| 1 | Lee Stracke | Asia | Chrome | Ubuntu | 57 |
| 2 | Winifred Langworth | Antarctica | Opera | Ubuntu | 41 |
| 3 | Rosendo Mann | Africa | Safari | Ubuntu | 35 |
| 4 | Ava Waelchi | Africa | Firefox | Mac OS | 45 |
| 5 | Afton Reilly | Antarctica | Internet Explorer | iOS | 84 |
| 6 | Reese Padberg | North America | Chrome | Ubuntu | 28 |
| 7 | Tressie Frami | South America | Safari | Ubuntu | 16 |
| 8 | Britney Mosciski | Asia | Opera | Windows | 8 |
| 9 | Emilio Turcotte | North America | Firefox | iOS | 96 |
| 10 | Gerda Schowalter | North America | Firefox | iOS | 2 |
| 11 | Grady Orn | South America | Opera | Android | 75 |
| 12 | Jerad Thiel | North America | Firefox | Ubuntu | 6 |
| 13 | Clare Stracke | South America | Opera | Mac OS | 51 |
| 14 | Jordon Auer | Asia | Firefox | Mac OS | 42 |
| 15 | Jaron Predovic | Asia | Internet Explorer | Ubuntu | 22 |
| 16 | Ahmed Moen | North America | Firefox | Android | 84 |
| 17 | Aaron Bednar | Australia | Chrome | Windows | 61 |
| 18 | Coy Ratke | Europe | Safari | Mac OS | 14 |
| 19 | Vernice Raynor | Asia | Internet Explorer | iOS | 4 |
| 20 | Nathan Crooks | Africa | Safari | Mac OS | 69 |
| 21 | Kayli Schneider | Europe | Edge | Mac OS | 48 |
| 22 | Brielle Rutherford | North America | Safari | Android | 30 |
| 23 | Terrance Leffler | Africa | Edge | Mac OS | 59 |
| 24 | Lane Mitchell | Europe | Safari | Ubuntu | 21 |
| 25 | Rosalind Dibbert | Africa | Opera | Mac OS | 19 |
| 26 | River Jerde | Africa | Opera | Ubuntu | 28 |
| 27 | Ronny Russel | South America | Safari | Ubuntu | 94 |
| 28 | Coralie Crist | North America | Safari | Mac OS | 78 |
| 29 | Dejuan Little | South America | Edge | Mac OS | 1 |
| 30 | Roberto Donnelly | Africa | Chrome | Mac OS | 35 |
| 31 | Penelope Price | Asia | Firefox | Android | 17 |
| 32 | Ila Grant | Asia | Firefox | Mac OS | 71 |
| 33 | Deangelo Howell | Australia | Opera | iOS | 71 |
| 34 | Kenya Stehr | South America | Edge | Ubuntu | 79 |
| 35 | Raul Hilll | Africa | Opera | Mac OS | 99 |
| 36 | Jadon Lindgren | Europe | Opera | Ubuntu | 5 |
| 37 | Sandrine Carroll | Africa | Firefox | Android | 18 |
| 38 | Deangelo Jenkins | Australia | Safari | Ubuntu | 20 |
| 39 | Meta Walker | Asia | Opera | Windows | 57 |
| 40 | Jennings Bartoletti | North America | Opera | Android | 34 |
| 41 | Elza Legros | Europe | Edge | Android | 44 |
| 42 | Shany Kessler | Africa | Safari | Android | 13 |
| 43 | Carole Gusikowski | North America | Opera | Ubuntu | 86 |
| 44 | Karina Rutherford | North America | Chrome | Mac OS | 52 |
| 45 | Roselyn Gulgowski | Europe | Safari | Ubuntu | 71 |
| 46 | Jamey Larkin | South America | Safari | Mac OS | 36 |
| 47 | Maryam Rohan | Australia | Chrome | Android | 80 |
| 48 | Blaise Cole | Europe | Chrome | Ubuntu | 3 |
| 49 | Jodie Kihn | North America | Chrome | iOS | 40 |
| 50 | Freida Jacobson | Asia | Opera | Mac OS | 11 |
| 51 | Gladyce Bauch | Australia | Chrome | iOS | 47 |
| 52 | Jett Rolfson | North America | Opera | Android | 3 |
| 53 | Hillard Krajcik | North America | Opera | Mac OS | 47 |
| 54 | Maureen Swaniawski | Europe | Safari | iOS | 42 |
| 55 | Tevin Simonis | Australia | Internet Explorer | Mac OS | 27 |
| 56 | Nelson Hahn | North America | Opera | Ubuntu | 13 |
| 57 | Danielle Kemmer | Africa | Opera | Android | 4 |
| 58 | Aglae Torphy | Asia | Opera | Ubuntu | 51 |
| 59 | Arielle Rosenbaum | Asia | Safari | iOS | 50 |
| # | Name | Continent | Browser | OS | Visits |
|---|
Index
<Grid
cellEditable
onCellEdited={(change, record) => {
console.log(change, record);
}}
records-bind="$page.records"
scrollable
buffered
style="height: 600px;"
lockColumnWidths
cached
columns={
[
{header: "#", field: "index", sortable: true, value: {bind: "$index"}},
{
header: "Name",
field: "fullName",
sortable: true,
editor: <cx>
<TextField
value-bind="$record.fullName"
style="position: absolute; width: 100%; height: 100%; top: 0;"
required
visited
/>
</cx>
},
{
header: "Continent", field: "continent", sortable: true,
editor: <cx>
<Select
value-bind="$record.continent"
style="position: absolute; width: 100%; height: 100%; top: 0;"
required
>
<option value="Africa">Africa</option>
<option value="Antarctica">Antarctica</option>
<option value="Asia">Asia</option>
<option value="Australia">Australia</option>
<option value="Europe">Europe</option>
<option value="North America">North America</option>
<option value="South America">South America</option>
</Select>
</cx>
},
{
header: "Browser", field: "browser", sortable: true,
editor: <cx>
<LookupField
value-bind="$record.browser"
style="position: absolute; width: 100%; height: 100%; top: 0;"
required
autoOpen
options={[
{ id: "Opera", text: "Opera" },
{ id: "Safari", text: "Safari" },
{ id: "Chrome", text: "Chrome" },
{ id: "Firefox", text: "Firefox" },
{ id: "Edge", text: "Edge" },
{ id: "Internet Explorer", text: "Internet Explorer" }
]}
/>
</cx>
},
{
header: "OS", field: "os", sortable: true,
editor: <cx>
<LookupField
value-bind="$record.os"
style="position: absolute; width: 100%; height: 100%; top: 0;"
required
autoOpen
options={[
{ id: "Mac OS", text: "Mac OS" },
{ id: "iOS", text: "iOS" },
{ id: "Android", text: "Android" },
{ id: "Windows", text: "Windows" },
{ id: "Ubuntu", text: "Ubuntu" },
]}
/>
</cx>
},
{
header: "Visits",
field: "visits",
sortable: true,
align: "right",
editor: <cx>
<NumberField
value-bind="$record.visits"
style="position: absolute; width: 100%; height: 100%; top: 0;"
required
visited
inputStyle="text-align: right"
/>
</cx>
}
]
}
/>