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 | Breanna Frami | South America | Opera | Android | 67 |
| 1 | Dewayne Bogan | Africa | Opera | Mac OS | 63 |
| 2 | Destinee Gulgowski | North America | Safari | Ubuntu | 77 |
| 3 | Sigurd Hudson | North America | Safari | Windows | 33 |
| 4 | Cecile Stracke | North America | Safari | Ubuntu | 1 |
| 5 | Veronica Collier | Europe | Firefox | Android | 61 |
| 6 | Enos Bailey | Asia | Opera | Windows | 86 |
| 7 | Ashleigh McDermott | Europe | Chrome | Windows | 38 |
| 8 | Arvilla Koch | Africa | Firefox | Mac OS | 31 |
| 9 | Curt Doyle | North America | Internet Explorer | Ubuntu | 5 |
| 10 | Vincenzo Kutch | South America | Safari | iOS | 35 |
| 11 | Patience Wuckert | North America | Firefox | Ubuntu | 3 |
| 12 | Genevieve Wolff | Asia | Chrome | Android | 1 |
| 13 | Marietta Bode | Australia | Firefox | Mac OS | 27 |
| 14 | Franco Reynolds | Australia | Edge | Windows | 63 |
| 15 | Markus Robel | South America | Opera | Mac OS | 74 |
| 16 | Art Hyatt | North America | Internet Explorer | Windows | 92 |
| 17 | Nasir Emmerich | Antarctica | Internet Explorer | Ubuntu | 70 |
| 18 | Carroll Schneider | Africa | Internet Explorer | Windows | 87 |
| 19 | Eloise Smitham | Antarctica | Safari | Mac OS | 99 |
| 20 | Curtis Altenwerth | South America | Safari | Android | 90 |
| 21 | Jess Sporer | South America | Internet Explorer | Windows | 18 |
| 22 | Jody Adams | Australia | Edge | Mac OS | 59 |
| 23 | Bennett Brown | Australia | Safari | Mac OS | 92 |
| 24 | Boyd Haley | North America | Internet Explorer | Ubuntu | 41 |
| 25 | Dustin Ryan | Europe | Safari | Mac OS | 5 |
| 26 | Easter Lowe | North America | Edge | Windows | 39 |
| 27 | Hailee Rutherford | Africa | Edge | Ubuntu | 4 |
| 28 | Corbin McGlynn | Asia | Chrome | Mac OS | 56 |
| 29 | Nelle Johnson | North America | Edge | iOS | 49 |
| 30 | Destiny Stanton | South America | Internet Explorer | iOS | 71 |
| 31 | Brycen Casper | North America | Edge | Mac OS | 78 |
| 32 | Wyatt Brekke | Asia | Edge | Mac OS | 33 |
| 33 | Lauren Baumbach | Antarctica | Firefox | Windows | 4 |
| 34 | Amie Botsford | South America | Opera | Android | 49 |
| 35 | Beverly Schaefer | South America | Internet Explorer | iOS | 8 |
| 36 | Gerson Nolan | Africa | Internet Explorer | Ubuntu | 18 |
| 37 | Colt Kreiger | Europe | Opera | Windows | 38 |
| 38 | Clifton Kerluke | Africa | Safari | Mac OS | 24 |
| 39 | Craig Okuneva | Australia | Safari | Android | 64 |
| 40 | Terrell Runolfsson | North America | Firefox | Ubuntu | 95 |
| 41 | Zechariah Predovic | South America | Firefox | Mac OS | 31 |
| 42 | Isom Goodwin | Antarctica | Edge | Mac OS | 38 |
| 43 | Muhammad Harber | Asia | Opera | Windows | 79 |
| 44 | Henri Streich | South America | Safari | Android | 90 |
| 45 | Adriana Steuber | Europe | Firefox | Mac OS | 73 |
| 46 | Noe Krajcik | Africa | Firefox | Android | 1 |
| 47 | Rupert Nienow | Asia | Chrome | Mac OS | 49 |
| 48 | Angus Schoen | Africa | Opera | Android | 87 |
| 49 | Madisyn Grant | South America | Internet Explorer | Android | 59 |
| 50 | Orlando Littel | Australia | Opera | Ubuntu | 2 |
| 51 | Jayson Beier | South America | Safari | Windows | 76 |
| 52 | Aurelie Runolfsdottir | Africa | Opera | iOS | 17 |
| 53 | Lupe Tillman | Africa | Opera | Windows | 11 |
| 54 | Cassandre Mertz | South America | Edge | Mac OS | 98 |
| 55 | Norberto Treutel | Africa | Opera | Mac OS | 21 |
| 56 | Faye Braun | Asia | Opera | Android | 66 |
| 57 | Emmie Wolff | South America | Firefox | Android | 55 |
| 58 | Karlee Morissette | North America | Firefox | iOS | 63 |
| 59 | Jamar Pfannerstill | Antarctica | Edge | Ubuntu | 65 |
| # | 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>
}
]
}
/>