Skip to content

Commit

Permalink
Data Shaping: add a note about getDataSource() (#5229) (#5240)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladaskorohodova authored Jun 22, 2023
1 parent 8c6000c commit bda25d6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Data shaping is implemented by the [DataSource](/api-reference/30%20Data%20Layer/DataSource '/Documentation/ApiReference/Data_Layer/DataSource/') component and its methods. To call them, get a **DataSource** instance from your UI component using the [getDataSource()](/api-reference/10%20UI%20Components/DataHelperMixin/3%20Methods/getDataSource().md '/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#getDataSource') method. Alternatively, you can use a standalone instance saved in a constant/component property when you created the **DataSource**.
Data shaping is implemented by the [DataSource](/api-reference/30%20Data%20Layer/DataSource '/Documentation/ApiReference/Data_Layer/DataSource/') component and its methods. To call them, use the [getDataSource()](/api-reference/10%20UI%20Components/DataHelperMixin/3%20Methods/getDataSource().md '/Documentation/ApiReference/UI_Components/dxDataGrid/Methods/#getDataSource') method to get a **DataSource** instance from your UI component. Alternatively, you can use a standalone instance saved in a constant/component property when you created the **DataSource**.

[note] The **getDataSource()**.[load()](/Documentation/ApiReference/Data_Layer/DataSource/Methods/#load) method re-renders the component. To avoid this behavior, use **getDataSource()**.[store()](/Documentation/ApiReference/Data_Layer/DataSource/Methods/#store).[load()](/Documentation/ApiReference/Data_Layer/ArrayStore/Methods/#load) instead.

The following code obtains a **DataSource** instance using both approaches and calls one of the data shaping methods—[filter(filterExpr)](/api-reference/30%20Data%20Layer/DataSource/3%20Methods/filter(filterExpr).md '/Documentation/ApiReference/Data_Layer/DataSource/Methods/#filterfilterExpr'). Such methods only set up data shaping settings. To apply them, the [load()](/api-reference/30%20Data%20Layer/DataSource/3%20Methods/load().md '/Documentation/ApiReference/Data_Layer/DataSource/Methods/#load') method is called.

Expand Down

0 comments on commit bda25d6

Please sign in to comment.