Inline Edit
Grid supports arbitrary content inside cells, allowing form fields to be always visible for immediate editing.
<Grid
controller={PageController}
records={m.records}
columns={[
{
header: "Name",
field: "fullName",
sortable: true,
children: <TextField value={m.$record.fullName} style="width: 100%" />,
pad: false,
class: "p-1!",
},
{
header: "Phone",
field: "phone",
children: <TextField value={m.$record.phone} style="width: 100%" />,
pad: false,
class: "p-1!",
},
{
header: "City",
field: "city",
sortable: true,
children: <TextField value={m.$record.city} style="width: 100%" />,
pad: false,
class: "p-1!",
},
{
header: "Notified",
field: "notified",
sortable: true,
align: "center",
pad: false,
children: <Checkbox value={m.$record.notified} />,
class: "p-1!",
},
]}
recordAlias={m.$record}
/> | Name | Phone | City | Notified |
|---|---|---|---|
All fields are editable directly in the grid without clicking to activate editing.
Using children Property
Use the children property on columns to embed widgets directly in cells:
<Grid
records={m.records}
columns={[
{
header: "Name",
field: "fullName",
sortable: true,
children: <TextField value={m.$record.fullName} style="width: 100%" />,
},
{
header: "Notified",
field: "notified",
align: "center",
pad: false,
children: <Checkbox value={m.$record.notified} />,
},
]}
recordAlias={m.$record}
/>
Styling Tips
- Use
style="width: 100%"on text fields to fill the cell - Use
pad: falseon columns with checkboxes for better alignment - Use
align: "center"for checkbox columns
When to Use
Inline editing is useful when:
- Users need to edit multiple records quickly
- The grid is the primary editing interface
- Changes should be immediately visible
For large datasets, consider Cell Editing for better performance.
See also: Cell Editing, Row Editing