Skip to content

Commit b508f71

Browse files
Edited documentation for PivotGird topics (#1399)
1 parent 0a7b64b commit b508f71

File tree

3 files changed

+60
-32
lines changed

3 files changed

+60
-32
lines changed

doc/en/components/grids/_shared/state-persistence.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The {ProductName} State Persistence in {Platform} {ComponentTitle} allows develo
1818
<!-- end: React, WebComponents -->
1919

2020
<!-- Blazor -->
21-
The {ProductName} State Persistence in {Platform} {ComponentTitle} allows developers to easily save and restore the grid state. When the `GridState` is applied on the {Platform} `{ComponentName}`, it exposes the `GetStateAsString` and `ApplyStateFromString` methods that developers can use to achieve state persistence in any scenario.
21+
The {ProductName} State Persistence in {Platform} {ComponentTitle} allows developers to easily save and restore the grid state. When the `GridState` is applied on the {Platform} `{ComponentName}`, it exposes the `GetStateAsStringAsync` and `ApplyStateFromStringAsync` methods that developers can use to achieve state persistence in any scenario.
2222
<!-- end: Blazor -->
2323

2424
## Supported Features
@@ -114,11 +114,17 @@ The developer may choose to get only the state for a certain feature/features, b
114114
The `GetState` method returns the grid state in a `GridStateInfo` object, containing all the state info. Additional steps may be required in order to save it.
115115
<!-- end: React, WebComponents -->
116116

117-
<!-- Blazor, React, WebComponents -->
117+
<!-- React, WebComponents -->
118118
The `GetStateAsString` returns a serialized JSON string, so developers can just take it and save it on any data storage (database, cloud, browser localStorage, etc).
119119

120120
The developer may choose to get only the state for a certain feature/features, by passing in an array with feature names as an argument. Empty array will result to using the default state options.
121-
<!-- end: Blazor, React, WebComponents -->
121+
<!-- end: React, WebComponents -->
122+
123+
<!-- Blazor -->
124+
The `GetStateAsStringAsync` returns a serialized JSON string, so developers can just take it and save it on any data storage (database, cloud, browser localStorage, etc).
125+
126+
The developer may choose to get only the state for a certain feature/features, by passing in an array with feature names as an argument. Empty array will result to using the default state options.
127+
<!-- end: Blazor -->
122128

123129
<!-- Angular -->
124130
```typescript
@@ -184,10 +190,10 @@ const sortingFilteringStates: IgrGridStateInfo = gridState.getState(['sorting',
184190
185191
@code {
186192
// get all features` state in a serialized JSON string
187-
string stateString = gridState.GetStateAsString(new string[0]);
193+
string stateString = gridState.GetStateAsStringAsync(new string[0]);
188194
189195
// get the sorting and filtering expressions
190-
string sortingFilteringStates = gridState.GetStateAsString(new string[] { "sorting", "filtering" });
196+
string sortingFilteringStates = gridState.GetStateAsStringAsync(new string[] { "sorting", "filtering" });
191197
}
192198
```
193199

@@ -199,9 +205,13 @@ const sortingFilteringStates: IgrGridStateInfo = gridState.getState(['sorting',
199205
`ApplyState` - The method accepts a `GridStateInfo` object as argument and will restore the state of each feature found in the object or specified features as second argument.
200206
<!-- end: React, WebComponents -->
201207

202-
<!-- Blazor, React, WebComponents -->
208+
<!-- React, WebComponents -->
203209
`ApplyStateFromString` - The method accepts a serialized JSON string as argument and will restore the state of each feature found in the JSON string or specified features as second argument.
204-
<!-- end: Blazor, React, WebComponents -->
210+
<!-- end: React, WebComponents -->
211+
212+
<!-- Blazor -->
213+
`ApplyStateFromStringAsync` - The method accepts a serialized JSON string as argument and will restore the state of each feature found in the JSON string or specified features as second argument.
214+
<!-- end: Blazor -->
205215

206216
<!-- Angular -->
207217
```typescript
@@ -225,8 +235,8 @@ gridState.applyState(sortingFilteringStates, [])
225235
```
226236

227237
```razor
228-
gridState.ApplyStateFromString(gridStateString, new string[0]);
229-
gridState.ApplyStateFromString(sortingFilteringStates, new string[0])
238+
gridState.ApplyStateFromStringAsync(gridStateString, new string[0]);
239+
gridState.ApplyStateFromStringAsync(sortingFilteringStates, new string[0])
230240
```
231241

232242
<!-- Angular -->
@@ -238,7 +248,7 @@ The `Options` object implements the `GridStateOptions` interface, i.e. for every
238248
<!-- end: React, WebComponents -->
239249

240250
<!-- Blazor -->
241-
The `Options` object implements the `GridStateOptions` interface, i.e. for every key, which is the name of a certain feature, there is the boolean value indicating if this feature state will be tracked. `GetStateAsString` methods will not put the state of these features in the returned value and `ApplyStateFromString` methods will not restore state for them.
251+
The `Options` object implements the `GridStateOptions` interface, i.e. for every key, which is the name of a certain feature, there is the boolean value indicating if this feature state will be tracked. `GetStateAsStringAsync` methods will not put the state of these features in the returned value and `ApplyStateFromStringAsync` methods will not restore state for them.
242252
<!-- end: Blazor -->
243253

244254
<!-- Angular -->
@@ -421,14 +431,14 @@ function restoreGridState() {
421431
}
422432
423433
async void SaveGridState() {
424-
string state = gridState.getStateAsString(new string[0]);
434+
string state = gridState.GetStateAsStringAsync(new string[0]);
425435
await JS.InvokeVoidAsync("window.localStorage.setItem", "grid-state", state);
426436
}
427437
428438
async void RestoreGridState() {
429439
string state = await JS.InvokeAsync<string>("window.localStorage.getItem", "grid-state");
430440
if (state) {
431-
gridState.ApplyStateFromString(state, new string[0]);
441+
gridState.ApplyStateFromStringAsync(state, new string[0]);
432442
}
433443
}
434444
}
@@ -953,7 +963,7 @@ this.state.applyState(state, ['filtering', 'rowIslands']);
953963
<!-- Blazor -->
954964
Then the `GetState` API will return the state for all grids (root grid and child grids) features excluding `Selection` and `Sorting`. If later on the developer wants to restore only the `Filtering` state for all grids, use:
955965
```razor
956-
gridState.ApplyStateFromString(gridStateString, new string[] { "filtering", "rowIslands" });
966+
gridState.ApplyStateFromStringAsync(gridStateString, new string[] { "filtering", "rowIslands" });
957967
```
958968
<!-- end: Blazor -->
959969
<!-- ComponentEnd: HierarchicalGrid -->
@@ -1101,9 +1111,13 @@ state.applyState(gridState.columnSelection);
11011111
* `GetState` method uses JSON.stringify() method to convert the original objects to a JSON string. JSON.stringify() does not support Functions, thats why the `GridState` directive will ignore the columns `Formatter`, `Filters`, `Summaries`, `SortStrategy`, `CellClasses`, `CellStyles`, `HeaderTemplate` and `BodyTemplate` properties.
11021112
<!-- end: Angular -->
11031113

1104-
<!-- Blazor, React, WebComponents -->
1114+
<!-- React, WebComponents -->
11051115
* `GetStateAsString` method uses JSON.stringify() method to convert the original objects to a JSON string. JSON.stringify() does not support Functions, thats why the `GridState` component will ignore the columns `Formatter`, `Filters`, `Summaries`, `SortStrategy`, `CellClasses`, `CellStyles`, `HeaderTemplate` and `BodyTemplate` properties.
1106-
<!-- end: Blazor, React, WebComponents -->
1116+
<!-- end: React, WebComponents -->
1117+
1118+
<!-- Blazor -->
1119+
* `GetStateAsString` method uses JSON.stringify() method to convert the original objects to a JSON string. JSON.stringify() does not support Functions, thats why the `GridState` component will ignore the columns `Formatter`, `Filters`, `Summaries`, `SortStrategy`, `CellClasses`, `CellStyles`, `HeaderTemplate` and `BodyTemplate` properties.
1120+
<!-- end: Blazor -->
11071121

11081122
<!-- ComponentEnd: Grid, HierarchicalGrid, TreeGrid -->
11091123

doc/en/components/grids/pivot-grid/remote-operations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public pivotConfigHierarchy: IPivotConfiguration = {
2222
<!-- WebComponents -->
2323
```typescript
2424
public pivotConfigHierarchy: IgcPivotConfiguration = {
25-
columnStrategy: NoopPivotDimensionsStrategy.instance(),
26-
rowStrategy: NoopPivotDimensionsStrategy.instance(),
25+
columnStrategy: IgcNoopPivotDimensionsStrategy.instance(),
26+
rowStrategy: IgcNoopPivotDimensionsStrategy.instance(),
2727
}
2828
```
2929
<!-- end: WebComponents -->

doc/jp/components/grids/_shared/state-persistence.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ _language: ja
1919
<!-- end: React, WebComponents -->
2020

2121
<!-- Blazor -->
22-
{Platform} {ComponentTitle} の {ProductName} 状態保持を使用すると、開発者はグリッドの状態を簡単に保存および復元できます。`GridState` が {Platform} `{ComponentName}` に適用されると、`GetStateAsString` および `ApplyStateFromString` メソッドが公開され、開発者はこれを使用して、あらゆるシナリオで状態の永続化を実現できます。
22+
{Platform} {ComponentTitle} の {ProductName} 状態保持を使用すると、開発者はグリッドの状態を簡単に保存および復元できます。`GridState` が {Platform} `{ComponentName}` に適用されると、`GetStateAsStringAsync` および `ApplyStateFromStringAsync` メソッドが公開され、開発者はこれを使用して、あらゆるシナリオで状態の永続化を実現できます。
2323
<!-- end: Blazor -->
2424

2525
## サポートされる機能
@@ -115,11 +115,17 @@ _language: ja
115115
`GetState` メソッドは、すべての状態情報を含むグリッドの状態を `GridStateInfo` オブジェクトで返します。保存するには追加の手順が必要になる場合があります。
116116
<!-- end: React, WebComponents -->
117117

118-
<!-- Blazor, React, WebComponents -->
118+
<!-- React, WebComponents -->
119119
`GetStateAsString` は、シリアル化された JSON 文字列を返します。これは、開発者がそれを取得して任意のデータストレージ (データベース、クラウド、ブラウザーの localStorage など) に保存できます。
120120

121121
開発者は、引数として機能名を含む配列を渡すことにより、特定の機能の状態のみを取得することを選択できます。空の配列では、デフォルトの状態オプションが使用されます。
122-
<!-- end: Blazor, React, WebComponents -->
122+
<!-- end: React, WebComponents -->
123+
124+
<!-- Blazor -->
125+
`GetStateAsStringAsync` は、シリアル化された JSON 文字列を返します。これは、開発者がそれを取得して任意のデータストレージ (データベース、クラウド、ブラウザーの localStorage など) に保存できます。
126+
127+
開発者は、引数として機能名を含む配列を渡すことにより、特定の機能の状態のみを取得することを選択できます。空の配列では、デフォルトの状態オプションが使用されます。
128+
<!-- end: Blazor -->
123129

124130
<!-- Angular -->
125131
```typescript
@@ -185,10 +191,10 @@ const sortingFilteringStates: IgrGridStateInfo = gridState.getState(['sorting',
185191
186192
@code {
187193
// get all features` state in a serialized JSON string
188-
string stateString = gridState.GetStateAsString(new string[0]);
194+
string stateString = gridState.GetStateAsStringAsync(new string[0]);
189195
190196
// get the sorting and filtering expressions
191-
string sortingFilteringStates = gridState.GetStateAsString(new string[] { "sorting", "filtering" });
197+
string sortingFilteringStates = gridState.GetStateAsStringAsync(new string[] { "sorting", "filtering" });
192198
}
193199
```
194200

@@ -200,9 +206,13 @@ const sortingFilteringStates: IgrGridStateInfo = gridState.getState(['sorting',
200206
`ApplyState` - このメソッドは引数として `GridStateInfo` オブジェクトを受け取り、オブジェクト内で見つかった各フィーチャまたは 2 番目の引数として指定されたフィーチャの状態を復元します。
201207
<!-- end: React, WebComponents -->
202208

203-
<!-- Blazor, React, WebComponents -->
209+
<!-- React, WebComponents -->
204210
`ApplyStateFromString` - このメソッドはシリアル化された JSON 文字列を引数として受け取り、JSON 文字列内で見つかった各機能の状態、または 2 番目の引数として指定された機能を復元します。
205-
<!-- end: Blazor, React, WebComponents -->
211+
<!-- end: React, WebComponents -->
212+
213+
<!-- Blazor -->
214+
`ApplyStateFromStringAsync` - このメソッドはシリアル化された JSON 文字列を引数として受け取り、JSON 文字列内で見つかった各機能の状態、または 2 番目の引数として指定された機能を復元します。
215+
<!-- end: Blazor -->
206216

207217
<!-- Angular -->
208218
```typescript
@@ -226,8 +236,8 @@ gridState.applyState(sortingFilteringStates, [])
226236
```
227237

228238
```razor
229-
gridState.ApplyStateFromString(gridStateString, new string[0]);
230-
gridState.ApplyStateFromString(sortingFilteringStates, new string[0])
239+
gridState.ApplyStateFromStringAsync(gridStateString, new string[0]);
240+
gridState.ApplyStateFromStringAsync(sortingFilteringStates, new string[0])
231241
```
232242

233243
<!-- Angular -->
@@ -239,7 +249,7 @@ gridState.ApplyStateFromString(sortingFilteringStates, new string[0])
239249
<!-- end: React, WebComponents -->
240250

241251
<!-- Blazor -->
242-
`Options` オブジェクトは、`GridStateOptions` インターフェースを実装します。特定の機能の名前であるキーには、この機能の状態を追跡するかどうかを示すブール値があります。`GetStateAsString` メソッドはこれらの機能の状態を戻り値に入れず、`ApplyStateFromString` メソッドはその状態を復元しません。
252+
`Options` オブジェクトは、`GridStateOptions` インターフェースを実装します。特定の機能の名前であるキーには、この機能の状態を追跡するかどうかを示すブール値があります。`GetStateAsStringAsync` メソッドはこれらの機能の状態を戻り値に入れず、`ApplyStateFromStringAsync` メソッドはその状態を復元しません。
243253
<!-- end: Blazor -->
244254

245255
<!-- Angular -->
@@ -422,14 +432,14 @@ function restoreGridState() {
422432
}
423433
424434
async void SaveGridState() {
425-
string state = gridState.getStateAsString(new string[0]);
435+
string state = gridState.GetStateAsStringAsync(new string[0]);
426436
await JS.InvokeVoidAsync("window.localStorage.setItem", "grid-state", state);
427437
}
428438
429439
async void RestoreGridState() {
430440
string state = await JS.InvokeAsync<string>("window.localStorage.getItem", "grid-state");
431441
if (state) {
432-
gridState.ApplyStateFromString(state, new string[0]);
442+
gridState.ApplyStateFromStringAsync(state, new string[0]);
433443
}
434444
}
435445
}
@@ -954,7 +964,7 @@ this.state.applyState(state, ['filtering', 'rowIslands']);
954964
<!-- Blazor -->
955965
`GetState` API は、`Selection``Sorting` を除くすべてのグリッド (ルート グリッドと子グリッド) 機能の状態を返します。開発者が後ですべてのグリッドの `Filtering` 状態のみを復元するには、以下を使用します。
956966
```razor
957-
gridState.ApplyStateFromString(gridStateString, new string[] { "filtering", "rowIslands" });
967+
gridState.ApplyStateFromStringAsync(gridStateString, new string[] { "filtering", "rowIslands" });
958968
```
959969
<!-- end: Blazor -->
960970
<!-- ComponentEnd: HierarchicalGrid -->
@@ -1102,9 +1112,13 @@ state.applyState(gridState.columnSelection);
11021112
* `GetState` メソッドは、JSON.stringify() メソッドを使用して、元のオブジェクトを JSON 文字列に変換します。JSON.stringify() が関数をサポートしないため、`GridState` ディレクティブは、columns `Formatter``Filters``Summaries``SortStrategy``CellClasses``CellStyles``HeaderTemplate` および `BodyTemplate` プロパティを無視します。
11031113
<!-- end: Angular -->
11041114

1105-
<!-- Blazor, React, WebComponents -->
1115+
<!-- React, WebComponents -->
11061116
* `GetStateAsString` メソッドは、JSON.stringify() メソッドを使用して、元のオブジェクトを JSON 文字列に変換します。JSON.stringify() が関数をサポートしないため、`GridState` コンポーネントは、列の `Formatter``Filters``Summaries``SortStrategy``CellClasses``CellStyles``HeaderTemplate` および `BodyTemplate` プロパティを無視します。
1107-
<!-- end: Blazor, React, WebComponents -->
1117+
<!-- end: React, WebComponents -->
1118+
1119+
<!-- Blazor -->
1120+
* `GetStateAsString` メソッドは、JSON.stringify() メソッドを使用して、元のオブジェクトを JSON 文字列に変換します。JSON.stringify() が関数をサポートしないため、`GridState` コンポーネントは、列の `Formatter``Filters``Summaries``SortStrategy``CellClasses``CellStyles``HeaderTemplate` および `BodyTemplate` プロパティを無視します。
1121+
<!-- end: Blazor -->
11081122

11091123
<!-- ComponentEnd: Grid, HierarchicalGrid, TreeGrid -->
11101124

0 commit comments

Comments
 (0)