Skip to content

Commit 29a26ba

Browse files
Grids: Update refresh() topic (DevExpress#7589) (DevExpress#7598)
1 parent 68c988d commit 29a26ba

File tree

1 file changed

+11
-5
lines changed
  • api-reference/10 UI Components/GridBase/3 Methods

1 file changed

+11
-5
lines changed

api-reference/10 UI Components/GridBase/3 Methods/refresh().md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ A Promise that is resolved after data is loaded.
1010
#include ref-promisedistinction
1111

1212
---
13-
The UI component cannot track changes a third party makes in the data source. To update data in the UI component in this case, call the **refresh()** method. [Data sources](/api-reference/_hidden/GridBaseColumn/lookup/dataSource.md '{basewidgetpath}/Configuration/columns/lookup/#dataSource') of lookup columns are updated with the main data source.
13+
**refresh()** calls [dataSource]({basewidgetpath}/Configuration/#dataSource).[reload()](/Documentation/ApiReference/Data_Layer/DataSource/Methods/#reload) and refreshes component properties such as [selection]({basewidgetpath}/Configuration/selection/) and lookup column [dataSources]({basewidgetpath}/Configuration/columns/lookup/#dataSource). This method also repaints all data rows if [repaintChangesOnly]({basewidgetpath}/Configuration/#repaintChangesOnly) is `false` (default).
1414

15-
The following code shows how to call this method:
15+
{WidgetName} cannot track data source changes applied outside of the component. To update the component in such cases, call the **refresh()** method.
16+
17+
The following code snippet shows how to call **refresh()**:
1618

1719
---
1820
#####jQuery
@@ -34,8 +36,6 @@ The following code shows how to call this method:
3436
<!-- ... -->
3537
</dx-{widget-name}>
3638

37-
<!---->
38-
3939
<!-- tab: app.component.ts -->
4040
import { Component, ViewChild } from '@angular/core';
4141

@@ -157,7 +157,13 @@ The following code shows how to call this method:
157157

158158
---
159159

160-
[note] Calling the **refresh()** method ends the editing process. In *batch* [editing mode](/api-reference/10%20UI%20Components/GridBase/1%20Configuration/editing/mode.md '{basewidgetpath}/Configuration/editing/#mode'), changes are saved in a buffer before they are saved to the data source. In other modes, all unsaved changes are discarded.
160+
[note]
161+
162+
- Calling the **refresh()** method in edit mode discards unsaved changes and cancels the edit mode. When **editing**.[mode](/api-reference/10%20UI%20Components/GridBase/1%20Configuration/editing/mode.md '{basewidgetpath}/Configuration/editing/#mode') is *"batch"*, the component cancels the edit mode but does not discard unsaved changes.
163+
- **refresh()** does not repaint the editing popup when **editing**.**mode** is *"popup"*.
164+
- The component may reject the **refresh** promise if {WidgetName} accesses its **dataSource** while the promise is in progress. To avoid rejecting the **refresh** promise, modify properties that initiate data queries after **refresh** is completed.
165+
166+
[/note]
161167

162168
#####See Also#####
163169
- [refresh(changesOnly)](/api-reference/10%20UI%20Components/GridBase/3%20Methods/refresh(changesOnly).md '/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#refreshchangesOnly')

0 commit comments

Comments
 (0)