{
    "componentChunkName": "component---src-templates-doc-page-jsx",
    "path": "/javascript-data-grid/cell-editing/",
    "result": {"data":{"markdownRemark":{"htmlAst":{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"h2","properties":{"id":"enable-editing","style":"position:relative;"},"children":[{"type":"text","value":"Enable Editing"},{"type":"element","tagName":"a","properties":{"href":"#enable-editing","ariaLabel":"enable editing permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To enable Cell Editing for a Column use the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"editable"}]},{"type":"text","value":" property on the Column Definition."}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"api-documentation","properties":{"source":"column-properties/properties.json","section":"editing","names":"[\"editable\"]"},"children":[]}]},{"type":"element","tagName":"snippet","properties":{"spacebetweenproperties":"true"},"children":[{"type":"text","value":"\nconst gridOptions = {\n    columnDefs: [\n        {\n            field: 'athlete',\n            // enables editing\n            editable: true\n        }\n    ]\n}\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"By default the grid provides simple string editing and stores the result as a string. The example below shows string editing enabled on all columns by setting "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"editable=true"}]},{"type":"text","value":" on the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"defaultColDef"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Simple Cell Editing","name":"simple-editing","type":"generated"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"conditional-editing","style":"position:relative;"},"children":[{"type":"text","value":"Conditional Editing"},{"type":"element","tagName":"a","properties":{"href":"#conditional-editing","ariaLabel":"conditional editing permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To dynamically determine which cells are editable, a callback function can be supplied to the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"editable"}]},{"type":"text","value":" property on the Column Definition:"}]},{"type":"element","tagName":"snippet","properties":{"spacebetweenproperties":"true"},"children":[{"type":"text","value":"\nconst gridOptions = {\n    columnDefs: [\n        {\n            field: 'athlete',\n            // conditionally enables editing for data for 2012\n            editable: (params) => params.data.year == 2012\n        }\n    ],\n}\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the snippet above, "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Athlete"}]},{"type":"text","value":" cells will be editable on rows where the "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Year"}]},{"type":"text","value":" is "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"2012"}]},{"type":"text","value":".     "}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This is demonstrated in the following example, note that:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"An "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"editable"}]},{"type":"text","value":" callback is added to the "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Athlete"}]},{"type":"text","value":" and "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Age"}]},{"type":"text","value":" columns to control which cells are editable based on the selected "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Year"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"A custom "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"editableColumn"}]},{"type":"text","value":" "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.5/column-definitions/#custom-column-types"},"children":[{"type":"text","value":"Column Type"}]},{"type":"text","value":" is used to avoid duplication of the callback for "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Athlete"}]},{"type":"text","value":" and "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Age"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Buttons are provided to change the "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Year"}]},{"type":"text","value":" used by the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"editable"}]},{"type":"text","value":" callback function to control which cells are editable.    "}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"A blue "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.5/cell-styles/"},"children":[{"type":"text","value":"Cell Style"}]},{"type":"text","value":" has been added to highlight editable cells using the same logic as the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"editable"}]},{"type":"text","value":" callback."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Conditional Cell Editing","name":"conditional-editing","type":"generated"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"editing-events","style":"position:relative;"},"children":[{"type":"text","value":"Editing Events"},{"type":"element","tagName":"a","properties":{"href":"#editing-events","ariaLabel":"editing events permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Cell editing results in the following events."}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"api-documentation","properties":{"source":"grid-events/events.json","section":"editing","names":"[\"cellValueChanged\",\"cellEditingStarted\",\"cellEditingStopped\",\"rowEditingStarted\",\"rowEditingStopped\",\"cellEditRequest\"]","config":"{\"overrideBottomMargin\":\"0rem\", \"hideMore\":false}"},"children":[]}]}]},"frontmatter":{"title":"Cell Editing","version":null,"enterprise":null,"sideMenu":null,"description":null},"headings":[{"id":"enable-editing","depth":2,"value":"Enable Editing"},{"id":"conditional-editing","depth":2,"value":"Conditional Editing"},{"id":"editing-events","depth":2,"value":"Editing Events"}]}},"pageContext":{"frameworks":["javascript","react","angular","vue"],"framework":"javascript","srcPath":"/cell-editing","pageName":"cell-editing"}},
    "staticQueryHashes": ["1766026005","699667431","940729948"]}