Documentation

Report Edit

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.

#NameContinentBrowserOSVisits
0Elwyn MannNorth AmericaSafariiOS44
1Clare LindgrenAustraliaChromeUbuntu30
2Mozelle HickleSouth AmericaSafariMac OS15
3Stefanie CronaAntarcticaOperaMac OS58
4Aliya NikolausAfricaOperaWindows85
5Amely YundtSouth AmericaOperaWindows85
6Neha SkilesEuropeSafariUbuntu75
7Leopold CruickshankAsiaSafariUbuntu61
8Oran WiegandNorth AmericaInternet ExplorerAndroid39
9Trudie PollichSouth AmericaSafariMac OS70
10Kristin MosciskiNorth AmericaInternet ExplorerMac OS73
11Lucie SchmelerAsiaSafariWindows65
12Cletus ParkerAfricaInternet ExplorerAndroid53
13Jace CasperNorth AmericaSafariUbuntu9
14Willa FlatleyAntarcticaChromeAndroid42
15Pamela KautzerAfricaSafariiOS9
16Deon BartolettiAsiaFirefoxiOS83
17Orion HansenAntarcticaFirefoxWindows45
18Shaina CartwrightAustraliaEdgeUbuntu45
19Carissa ReichelAfricaInternet ExplorerAndroid32
20Nikolas TrantowNorth AmericaEdgeAndroid15
21Vesta WisokySouth AmericaSafariiOS32
22Ona EmardSouth AmericaSafariUbuntu8
23Itzel DeckowNorth AmericaChromeMac OS57
24Phoebe GreenAntarcticaSafariUbuntu62
25Zoey PacochaAntarcticaFirefoxAndroid66
26Katheryn KuhicAustraliaInternet ExplorerAndroid73
27Elissa HartmannSouth AmericaSafariMac OS87
28Marianna MarvinAfricaChromeAndroid28
29Mabelle OsinskiAfricaFirefoxiOS60
30Sienna EmardNorth AmericaOperaMac OS89
31Crystel BaumbachAntarcticaFirefoxUbuntu89
32Scot SchroederAfricaInternet ExplorerMac OS64
33Kristian RennerAustraliaSafariAndroid99
34Dustin BodeAsiaInternet ExplorerUbuntu35
35Dolly KoelpinNorth AmericaFirefoxAndroid65
36Madelyn ProsaccoAfricaChromeMac OS47
37Iliana FisherAsiaFirefoxMac OS74
38Brenda WelchAfricaEdgeMac OS94
39Tessie ParkerAsiaFirefoxAndroid55
40Arvilla PurdyAfricaChromeAndroid80
41Davonte HoegerEuropeInternet ExplorerUbuntu77
42Sydnie KuphalNorth AmericaEdgeiOS39
43Karl MurazikAustraliaOperaAndroid38
44Renee LehnerEuropeChromeMac OS98
45Adolf BednarAfricaEdgeMac OS63
46Margie FritschAustraliaEdgeAndroid25
47Corbin WestAsiaEdgeAndroid48
48Dorothea KlingAfricaOperaMac OS93
49Dana RobelEuropeChromeAndroid74
50Annie BradtkeAntarcticaChromeMac OS68
51Abdul DooleyAsiaEdgeWindows73
52Crystal MayerNorth AmericaOperaUbuntu37
53Parker KiehnAntarcticaOperaMac OS12
54River WiegandAustraliaOperaMac OS32
55Marisa GreenfelderAustraliaInternet ExplorerAndroid78
56Joany WiegandNorth AmericaChromeUbuntu37
57Joana TorpAustraliaOperaWindows3
58Abdiel HarberAsiaChromeWindows96
59Percy WelchAsiaOperaAndroid72
#NameContinentBrowserOSVisits
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>
            }
        ]
    }
/>
Copied!Cx Fiddle