Skip to content

Commit 29d4c10

Browse files
Merge pull request SharePoint#7485 from SamueleFurnari/patch-1
Add steps to allow the DetailedQuickView to works
2 parents 69d7ee9 + 2eaa182 commit 29d4c10

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

docs/spfx/viva/get-started/advanced-quick-view-functionality.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Advanced Quick View Functionality
33
description: "This tutorial builds off the tutorial 'Advanced Card View Functionality'."
4-
ms.date: 10/25/2021
4+
ms.date: 11/11/2021
55
ms.prod: sharepoint
66
ms.localizationpriority: high
77
---
@@ -49,11 +49,11 @@ Start with the HelloWorld ACE from the previous tutorial, [Advanced Card View Fu
4949
"type": "Action.Submit",
5050
"data": {
5151
"id": "selectAction",
52-
"newIndex": "${index}",
52+
"newIndex": "${index}"
5353
}
5454
},
5555
"separator": true,
56-
"items": [ // The template for an item in `items`
56+
"items": [
5757
{
5858
"type": "TextBlock",
5959
"text": "${title}",
@@ -79,6 +79,26 @@ Start with the HelloWorld ACE from the previous tutorial, [Advanced Card View Fu
7979
}
8080
```
8181

82+
1. As you can see in the JSON template, we use the ${index} to pass the selected item index to the QuickView. To allow this to works, we must add and populate `index` property of the `IListItem` object defined in the previous tutorial. Open and locate the file **./src/adaptiveCardExtensions/helloWorld/HelloWorldAdaptiveCardExtension.ts**, than add the property `index` to the `IListItem` definition:
83+
84+
```typescript
85+
export interface IListItem {
86+
title: string;
87+
description: string;
88+
index: number;
89+
}
90+
```
91+
92+
1. Finally locate the `fetchData()` method in the same class and modify the map function inside it, to:
93+
94+
```typescript
95+
...
96+
.then((jsonResponse) => jsonResponse.value.map(
97+
(item, index) => { return { title: item.Title, description: item.Description, index: index }; })
98+
)
99+
...
100+
```
101+
82102
Build and launch the ACE in the hosted workbench:
83103

84104
```console

0 commit comments

Comments
 (0)