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
0Braxton BorerEuropeSafariAndroid50
1Brody HermistonAfricaInternet ExploreriOS25
2Rashawn SchmidtAsiaInternet ExplorerWindows46
3Marcel BernierAfricaOperaUbuntu5
4Sheridan DickinsonNorth AmericaSafariUbuntu73
5Maryse PagacEuropeChromeMac OS15
6Liam LangoshAustraliaEdgeMac OS8
7Henderson LynchAustraliaInternet ExplorerAndroid22
8Hattie WardEuropeEdgeAndroid6
9Trenton ToyAustraliaSafariAndroid51
10Dessie ArmstrongSouth AmericaInternet ExplorerUbuntu52
11Aglae ZboncakNorth AmericaSafariiOS74
12Madie RennerAfricaSafariiOS90
13Althea BahringerAfricaFirefoxUbuntu75
14Roosevelt ToyNorth AmericaOperaiOS80
15Aniyah FeestAfricaInternet ExplorerAndroid77
16Candelario SmithamNorth AmericaFirefoxAndroid29
17Ayana MacejkovicAfricaOperaWindows86
18Evangeline StoltenbergAfricaOperaMac OS65
19Laurel BlickAsiaOperaWindows46
20Angie HoppeAntarcticaFirefoxUbuntu74
21Candice EffertzAfricaOperaUbuntu44
22Ethyl HaneAfricaSafariAndroid58
23Jarret LegrosAfricaChromeAndroid62
24Valerie ConnAustraliaOperaUbuntu97
25Mohammed DoyleEuropeOperaWindows96
26Alverta VolkmanNorth AmericaFirefoxUbuntu64
27Riley GradyAustraliaInternet ExplorerUbuntu72
28Leslie NikolausAsiaOperaMac OS11
29Dayna RolfsonAfricaFirefoxWindows72
30Nettie JohnstonNorth AmericaOperaMac OS2
31Elinore OsinskiAustraliaChromeMac OS93
32Rae JohnsonNorth AmericaSafariAndroid23
33Elvera MoenAfricaFirefoxUbuntu86
34Lamont KemmerAntarcticaEdgeUbuntu10
35Demarco MooreAntarcticaInternet ExplorerMac OS96
36Harley RauAustraliaFirefoxWindows84
37Lowell AdamsNorth AmericaChromeAndroid27
38Penelope DaughertyNorth AmericaEdgeUbuntu89
39Colton GusikowskiAfricaEdgeUbuntu67
40Matteo ProhaskaAustraliaInternet ExplorerWindows28
41Susanna VonAfricaSafariMac OS22
42Phyllis BoscoAfricaSafariiOS99
43Magali StantonAntarcticaSafariiOS97
44Ernest LeannonAntarcticaOperaUbuntu61
45Blanche WillAfricaInternet ExplorerAndroid54
46Missouri JaskolskiAfricaEdgeMac OS94
47Serenity RatkeAustraliaInternet ExplorerUbuntu34
48Reyna MurazikNorth AmericaEdgeWindows12
49Jayson HaagSouth AmericaInternet ExplorerMac OS90
50Lucie WhiteNorth AmericaChromeMac OS38
51Ellen BodeAsiaOperaMac OS62
52Jeanette EmmerichAsiaSafariUbuntu75
53Jimmie MooreAustraliaChromeAndroid26
54Reyna ProsaccoAustraliaSafariAndroid8
55Merl DavisSouth AmericaEdgeWindows90
56Shyann HalvorsonNorth AmericaFirefoxiOS58
57Adeline FeilAustraliaInternet ExplorerWindows50
58Cora MarvinAustraliaSafariMac OS51
59Aisha MorarAsiaInternet ExplorerMac OS89
#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