Skip to content

Commit 07d815e

Browse files
adnanqaopsgitbook-bot
authored andcommitted
GITBOOK-170: Updated List View page with Demos and a Example
1 parent 3dbaab4 commit 07d815e

File tree

1 file changed

+13
-13
lines changed
  • docs/build-applications/app-editor/visual-components

1 file changed

+13
-13
lines changed

docs/build-applications/app-editor/visual-components/list-view.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
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.
44

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) : 
66

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.
7+
{% embed url="https://demos.lowcoder.cloud/demo/clz2tcvmi3cb5z9kdmrxcm9kl" %}
88

9-
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.
1010

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.
14+
15+
{% embed url="https://demos.lowcoder.cloud/demo/clz2ubz2v3csqz9kdxugs5szi" %}
1216

1317
## Bind data
1418

@@ -40,10 +44,6 @@ You can view the detailed data about the **List View** component, its items, the
4044

4145
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.
4246

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-
4747
## Name items
4848

4949
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
5252

5353
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.
5454

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.
5656

5757
```javascript
58-
{{getAllFictions.data[i].book_name}}
58+
{{listview1.data[i].title}}
5959
```
6060

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.
6262

6363
### Item data name
6464

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.
6666

6767
```javascript
68-
{{i+1}}. {{currentItem.book_name}}
68+
{{i+1}}. {{currentItem.title}}
6969
```
7070

7171
{% hint style="info" %}

0 commit comments

Comments
 (0)