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: docs/build-applications/app-editor/visual-components/list-view.md
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,17 @@
2
2
3
3
The component **List View** displays rows of data. Similar to Form, Modal, and Drawer, it is also a container-like component that can hold other components or modules. For list viewing data, you first bind the data to a **List View** component and configure the naming rules for the items. Then, you design the display of the first row by dragging and dropping components, and this layout will be applied to all items within this component.
4
4
5
-
The following is a demo of **List View**, displaying part of BEST BOOKS OF 2021 from [Goodreads](https://www.goodreads.com/choiceawards/best-books-2021):
5
+
The following is a demo of **List View**, displaying movies from [IMDB](https://www.imdb.com/chart/top/?ref\_=nv\_mv\_250) : 
6
6
7
-
Drag and drop **List View** onto the canvas. Each item contains an **Image**, a **Text** and a **Rating** component. You can update the exhibition of the whole **List View** component by configuring the layout of the first entry.
Click the **Image**component, you see the defaulted image source.
9
+
Drag and drop **List View** onto the canvas. Each item contains an **Image**, a **Title** with **URL/Link** and a **Rating**component. You can update the exhibition of the whole **List View** component by configuring the layout of the first entry.
10
10
11
-
The **List View** component retrieves data from a JSON array of objects and displays an **Image**, a **Text** and a **Rating** component for each entry. You can also pass query results to a **List View**.
11
+
Click the **Title** component, and you will redirected to Movie page in a new Tab.
12
+
13
+
The **List View** component retrieves data from a JSON array of objects and displays an **Image**, a **Title** and a **Rating** component for each entry. You can also pass query results to a **List View** and show dynamic data inside **List View** component. Following demo shows a **List View** showing Dynamic data via a REST query.
@@ -40,10 +44,6 @@ You can view the detailed data about the **List View** component, its items, the
40
44
41
45
After binding valid data to **List View** component and designing its inside components, you can add data to these components. **List View** supports local variables `currentItem` and `i`. Notice that you only need to change data of the first row, and the same settings are applied to the other rows automatically.
42
46
43
-
{% hint style="info" %}
44
-
You can bind a static URL address to the **Image** component for image display; and because that URL address is static, the same image shows up in all rows.
45
-
{% endhint %}
46
-
47
47
## Name items
48
48
49
49
You can set the item index names and item data names. This is useful when embedding a list in another list. For example, you can set the index of one list as `i`, and the inner nested `j` to avoid naming conflict.
@@ -52,20 +52,20 @@ You can set the item index names and item data names. This is useful when embedd
52
52
53
53
By default, item index is named as`i`, referring to the index of list data and starting from zero. Besides using `i` as numbers, you can also use `i` to dynamically access data from query results.
54
54
55
-
For example, to access the `book_name` field from table `fiction` in the **Text** component, write the following code.
55
+
For example, to access the `title` field from the object`Data` in the **Text** component, write the following code.
56
56
57
57
```javascript
58
-
{{getAllFictions.data[i].book_name}}
58
+
{{listview1.data[i].title}}
59
59
```
60
60
61
-
Then you can see the fiction book names displayed in **List View** by index order.
61
+
Then you can see the Movies title displayed in **List View** by index order.
62
62
63
63
### Item data name
64
64
65
-
By default, you can reference the value of each item within a list using variable `currentItem`. For example, to display a serial number plus book name, write the following code in `text1` value.
65
+
By default, you can reference the value of each item within a list using variable `currentItem`. For example, to display a serial number plus Movie Title, write the following code in `text` value.
0 commit comments