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 | Braxton Borer | Europe | Safari | Android | 50 |
| 1 | Brody Hermiston | Africa | Internet Explorer | iOS | 25 |
| 2 | Rashawn Schmidt | Asia | Internet Explorer | Windows | 46 |
| 3 | Marcel Bernier | Africa | Opera | Ubuntu | 5 |
| 4 | Sheridan Dickinson | North America | Safari | Ubuntu | 73 |
| 5 | Maryse Pagac | Europe | Chrome | Mac OS | 15 |
| 6 | Liam Langosh | Australia | Edge | Mac OS | 8 |
| 7 | Henderson Lynch | Australia | Internet Explorer | Android | 22 |
| 8 | Hattie Ward | Europe | Edge | Android | 6 |
| 9 | Trenton Toy | Australia | Safari | Android | 51 |
| 10 | Dessie Armstrong | South America | Internet Explorer | Ubuntu | 52 |
| 11 | Aglae Zboncak | North America | Safari | iOS | 74 |
| 12 | Madie Renner | Africa | Safari | iOS | 90 |
| 13 | Althea Bahringer | Africa | Firefox | Ubuntu | 75 |
| 14 | Roosevelt Toy | North America | Opera | iOS | 80 |
| 15 | Aniyah Feest | Africa | Internet Explorer | Android | 77 |
| 16 | Candelario Smitham | North America | Firefox | Android | 29 |
| 17 | Ayana Macejkovic | Africa | Opera | Windows | 86 |
| 18 | Evangeline Stoltenberg | Africa | Opera | Mac OS | 65 |
| 19 | Laurel Blick | Asia | Opera | Windows | 46 |
| 20 | Angie Hoppe | Antarctica | Firefox | Ubuntu | 74 |
| 21 | Candice Effertz | Africa | Opera | Ubuntu | 44 |
| 22 | Ethyl Hane | Africa | Safari | Android | 58 |
| 23 | Jarret Legros | Africa | Chrome | Android | 62 |
| 24 | Valerie Conn | Australia | Opera | Ubuntu | 97 |
| 25 | Mohammed Doyle | Europe | Opera | Windows | 96 |
| 26 | Alverta Volkman | North America | Firefox | Ubuntu | 64 |
| 27 | Riley Grady | Australia | Internet Explorer | Ubuntu | 72 |
| 28 | Leslie Nikolaus | Asia | Opera | Mac OS | 11 |
| 29 | Dayna Rolfson | Africa | Firefox | Windows | 72 |
| 30 | Nettie Johnston | North America | Opera | Mac OS | 2 |
| 31 | Elinore Osinski | Australia | Chrome | Mac OS | 93 |
| 32 | Rae Johnson | North America | Safari | Android | 23 |
| 33 | Elvera Moen | Africa | Firefox | Ubuntu | 86 |
| 34 | Lamont Kemmer | Antarctica | Edge | Ubuntu | 10 |
| 35 | Demarco Moore | Antarctica | Internet Explorer | Mac OS | 96 |
| 36 | Harley Rau | Australia | Firefox | Windows | 84 |
| 37 | Lowell Adams | North America | Chrome | Android | 27 |
| 38 | Penelope Daugherty | North America | Edge | Ubuntu | 89 |
| 39 | Colton Gusikowski | Africa | Edge | Ubuntu | 67 |
| 40 | Matteo Prohaska | Australia | Internet Explorer | Windows | 28 |
| 41 | Susanna Von | Africa | Safari | Mac OS | 22 |
| 42 | Phyllis Bosco | Africa | Safari | iOS | 99 |
| 43 | Magali Stanton | Antarctica | Safari | iOS | 97 |
| 44 | Ernest Leannon | Antarctica | Opera | Ubuntu | 61 |
| 45 | Blanche Will | Africa | Internet Explorer | Android | 54 |
| 46 | Missouri Jaskolski | Africa | Edge | Mac OS | 94 |
| 47 | Serenity Ratke | Australia | Internet Explorer | Ubuntu | 34 |
| 48 | Reyna Murazik | North America | Edge | Windows | 12 |
| 49 | Jayson Haag | South America | Internet Explorer | Mac OS | 90 |
| 50 | Lucie White | North America | Chrome | Mac OS | 38 |
| 51 | Ellen Bode | Asia | Opera | Mac OS | 62 |
| 52 | Jeanette Emmerich | Asia | Safari | Ubuntu | 75 |
| 53 | Jimmie Moore | Australia | Chrome | Android | 26 |
| 54 | Reyna Prosacco | Australia | Safari | Android | 8 |
| 55 | Merl Davis | South America | Edge | Windows | 90 |
| 56 | Shyann Halvorson | North America | Firefox | iOS | 58 |
| 57 | Adeline Feil | Australia | Internet Explorer | Windows | 50 |
| 58 | Cora Marvin | Australia | Safari | Mac OS | 51 |
| 59 | Aisha Morar | Asia | Internet Explorer | Mac OS | 89 |
| # | 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>
}
]
}
/>