diff --git a/README.md b/README.md index 95ae7d8..3e99775 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,20 @@ -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/723096689/23.1.3%2B) [![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1202789) [![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) -# DevExtreme Examples Template +# DataGrid for DevExtreme - How to Validate Unchanged Cells -This is the repository template for creating new examples. +This example demonstrates how to validate unchanged cells in the DataGrid component with a button click. To implement this functionality, define the `validateVisibleRows` function: -Use **_Product_ for DevExtreme - _Task_** template for a title. +1. Specify rows that need validation. To validate all rows, obtain [visible rows](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#getVisibleRows) and create an array of corresponding change objects. Assign the array to the [changes](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/editing/changes/) property. -Describe the solved task in this section. +2. [Repaint](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#repaint) the DataGrid. -Put a screenshot/gif that illustrates the result here. +3. Use the **private** `getController` method to run validation. -Then, add implementation details (steps, code snippets, and other technical information in a free form), or add a link to an existing document with implementation details. +![DataGrid with validated unchanged cells](/data-grid-validate-unchanged-cells.png) + +If you want to validate unchanged cells after DataGrid is loaded, call the `validateVisibleRows` function in the [onContentReady](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#onContentReady) event handler. ## Files to Review @@ -31,12 +32,6 @@ Then, add implementation details (steps, code snippets, and other technical info ## Documentation -- link -- link -- ... - -## More Examples - -- link -- link -- ... +- [editing.changes](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/editing/changes/) +- [getVisibleRows()](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#getVisibleRows) +- [onContentReady](https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxDataGrid/Configuration/#onContentReady) diff --git a/data-grid-validate-unchanged-cells.png b/data-grid-validate-unchanged-cells.png new file mode 100644 index 0000000..0e26001 Binary files /dev/null and b/data-grid-validate-unchanged-cells.png differ