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
0Halle BlickAfricaSafariiOS40
1Moises MooreSouth AmericaInternet ExplorerUbuntu54
2Antone VolkmanSouth AmericaFirefoxiOS16
3Cordia HickleSouth AmericaOperaUbuntu48
4Otto WisozkAsiaFirefoxUbuntu38
5Sarai JohnstonSouth AmericaOperaUbuntu97
6Sabina GutkowskiSouth AmericaSafariUbuntu64
7Renee RobertsAustraliaInternet ExplorerAndroid6
8Zella KlockoAsiaOperaUbuntu40
9Vivianne BartolettiNorth AmericaFirefoxUbuntu14
10Addison ZiemeSouth AmericaOperaAndroid12
11Jayme GulgowskiAsiaSafariAndroid67
12Samantha KirlinAntarcticaInternet ExplorerUbuntu11
13Willie MooreSouth AmericaInternet ExplorerAndroid12
14Kenneth DibbertAustraliaFirefoxMac OS31
15Ford KonopelskiAfricaFirefoxMac OS23
16Tyra RunteAfricaFirefoxWindows26
17Alivia DouglasSouth AmericaOperaWindows64
18Bridget SchimmelAfricaFirefoxMac OS98
19Kelley BeierAsiaFirefoxMac OS60
20Davon JonesNorth AmericaFirefoxMac OS15
21Douglas ZiemannAfricaInternet ExplorerMac OS60
22Onie GreenfelderNorth AmericaInternet ExplorerWindows94
23Tom GislasonNorth AmericaOperaAndroid100
24Krystina PollichSouth AmericaFirefoxAndroid64
25Yvonne NitzscheAustraliaSafariWindows53
26Darrion KrajcikAfricaInternet ExplorerUbuntu35
27Pierre LueilwitzAntarcticaFirefoxWindows93
28Eduardo ArmstrongAntarcticaFirefoxUbuntu99
29Skylar MorissetteNorth AmericaFirefoxAndroid5
30Orie BarrowsSouth AmericaFirefoxMac OS47
31Adan LangAsiaInternet ExplorerWindows54
32Burdette ReichertAsiaOperaMac OS58
33Kenyon MorissetteAsiaInternet ExplorerWindows85
34Sidney NaderAsiaInternet ExplorerUbuntu36
35Matt RobelSouth AmericaSafariiOS15
36Carmine HackettAfricaEdgeMac OS51
37Joesph SchroederAsiaChromeAndroid55
38Margret WildermanNorth AmericaOperaWindows19
39Bridie MarvinNorth AmericaSafariAndroid72
40Everett LefflerAsiaFirefoxUbuntu73
41Leila ConroyNorth AmericaChromeUbuntu88
42Ignacio StammSouth AmericaOperaMac OS90
43Pearl SpencerSouth AmericaOperaiOS25
44Domingo ConroyAustraliaEdgeiOS80
45Enos WindlerNorth AmericaInternet ExploreriOS58
46Joanny HeaneySouth AmericaFirefoxiOS96
47Zechariah MosciskiEuropeOperaUbuntu44
48Cecile RatkeAustraliaInternet ExplorerMac OS12
49Halie PfefferAntarcticaSafariAndroid70
50Devin GusikowskiSouth AmericaOperaMac OS10
51Gay CollinsEuropeInternet ExplorerWindows38
52Chelsie AbernathySouth AmericaSafariMac OS96
53Lenore TerrySouth AmericaFirefoxAndroid34
54Cyrus LynchAsiaSafariMac OS19
55Wilburn WalkerAustraliaSafariMac OS76
56Bruce EmmerichAustraliaOperaMac OS81
57Herman QuigleyAustraliaChromeWindows61
58Tracey NikolausSouth AmericaSafariMac OS11
59Ressie KshlerinSouth AmericaOperaAndroid41
#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