{
    "componentChunkName": "component---src-templates-doc-page-jsx",
    "path": "/angular-data-grid/data-update-single-row-cell/",
    "result": {"data":{"markdownRemark":{"htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can target updates to a single row or cell. Updating a single row means asking the grid to replace the data item for one specific row. Updating a cell means keeping the data item but asking the grid to replace one attribute of that data item."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Both single row and single cell updates are done by first getting a reference to the row's Row Node and then using the relevant Row Node API method. See "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.5/accessing-data/"},"children":[{"type":"text","value":"Accessing Data"}]},{"type":"text","value":" on how to access Row Nodes.\nOnce you have access to the required Row Node, you update its data with the following Row Node API methods:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"api-documentation","properties":{"source":"row-object/resources/methods.json","section":"rowNodeMethods","names":"[\"setData\", \"setDataValue\"]"},"children":[]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"view-refresh","style":"position:relative;"},"children":[{"type":"text","value":"View Refresh"},{"type":"element","tagName":"a","properties":{"href":"#view-refresh","ariaLabel":"view refresh 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":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After calling "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"rowNode.setData"}]},{"type":"text","value":" or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"rowNode.setDataValue"}]},{"type":"text","value":" the grid's view will automatically refresh to reflect the change. There is no need to manually request a refresh."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"sort--filter--group-refresh","style":"position:relative;"},"children":[{"type":"text","value":"Sort / Filter / Group Refresh"},{"type":"element","tagName":"a","properties":{"href":"#sort--filter--group-refresh","ariaLabel":"sort  filter  group refresh 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":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After calling "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"rowNode.setData"}]},{"type":"text","value":" or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"rowNode.setDataValue"}]},{"type":"text","value":" the grid will not update to reflect a change in sorting, filtering or grouping."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To have the grid update its sort, filter or grouping call the Grid API "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"refreshClientSideRowModel()"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If you want the grid to automatically update sorting, filter or grouping then you should consider using "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.5/data-update-transactions/"},"children":[{"type":"text","value":"Transaction Updates"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"updating-rows--cells-example","style":"position:relative;"},"children":[{"type":"text","value":"Updating Rows / Cells Example"},{"type":"element","tagName":"a","properties":{"href":"#updating-rows--cells-example","ariaLabel":"updating rows  cells example 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":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The example below demonstrates the following:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Set Price on Toyota:"}]},{"type":"text","value":" The price value is updated on the Toyota row and the grid refreshes the cell."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Set Data on Ford:"}]},{"type":"text","value":" The entire data is set on the Ford row and the grid refreshes the entire row."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Sort:"}]},{"type":"text","value":" Re-runs the sort in the Client-Side Row Model - to see this in action, sort the data first, then edit the data so the sort is broken, then hit this button to fix the sort."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Filter:"}]},{"type":"text","value":" Re-runs the filter in the Client-Side Row Model - to see this in action, filter the data first, then\nedit the data so the filter is broken (i.e. a row is present that should not be present), then hit this button to fix the filter."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Updating Row Nodes","name":"updating-row-nodes","type":"generated"},"children":[]}]}],"data":{"quirksMode":false}},"frontmatter":{"title":"Client-Side Data - Single Row / Cell Updates","version":null,"enterprise":null,"sideMenu":null,"description":null},"headings":[{"id":"view-refresh","depth":2,"value":"View Refresh"},{"id":"sort--filter--group-refresh","depth":2,"value":"Sort / Filter / Group Refresh"},{"id":"updating-rows--cells-example","depth":2,"value":"Updating Rows / Cells Example"}]}},"pageContext":{"frameworks":["javascript","react","angular","vue"],"framework":"angular","srcPath":"/data-update-single-row-cell","pageName":"data-update-single-row-cell"}},
    "staticQueryHashes": ["1766026005","699667431","940729948"]}