You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api-reference/10 UI Components/GridBase/3 Methods/refresh().md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,11 @@ A Promise that is resolved after data is loaded.
10
10
#include ref-promisedistinction
11
11
12
12
---
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).
14
14
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()**:
16
18
17
19
---
18
20
#####jQuery
@@ -34,8 +36,6 @@ The following code shows how to call this method:
34
36
<!-- ... -->
35
37
</dx-{widget-name}>
36
38
37
-
<!---->
38
-
39
39
<!-- tab: app.component.ts -->
40
40
import { Component, ViewChild } from '@angular/core';
41
41
@@ -157,7 +157,13 @@ The following code shows how to call this method:
157
157
158
158
---
159
159
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.
0 commit comments