Help Center/ Huawei Cloud Astro Canvas/ User Guide/ Widget Management/ Using the Background Pagination Function of Advanced Tables
Updated on 2025-03-24 GMT+08:00

Using the Background Pagination Function of Advanced Tables

The background pagination function requires global variables. To implement background pagination, add the total field to the total number of data records during widget preview.

Background Pagination

  1. Log in to Huawei Cloud Astro Canvas by referring to Logging In to Huawei Cloud Astro Canvas.
  2. Create a large screen page, drag the advanced table widget from the All > Text area to the blank area of the canvas.
  3. Enable the background pagination function.

    Figure 1 Enabling the background pagination function

  4. Create global variables.

    The background pagination function requires global variables. Create pageSize and offset variables (names can be customized) and set default values for them. The two variables are required when the pagination function is triggered or the number of records per page changes. Therefore, they need initial values; otherwise, data configuration cannot work.
    Figure 2 Creating global variables

  5. Set the interaction.

    1. Select the advanced table widget and click to configure the widget interaction.
    2. Add an interaction action under the pagination switching area.
      Figure 3 Interaction action during pagination switching
    3. Add an interaction action under the number of data records on the current page is switched area.
      Figure 4 Interaction action when the number of data records on the current page is switched

  6. Set the widget data.

    1. Select the widget. Click above the widget.
    2. Select the required data type.
    3. In the configuration process, use SQL statements to obtain data.
      In the SQL statements for data access, add the global variables offset and pageSize created in 4 to limit the data obtained each time.
      Figure 5 Entering SQL statements
      Figure 6 Entering $ to add a global variable
    4. In the widget preview area, drag the fields in the table to the corresponding configuration area.
      The total field must be added to the total number of data records.
      Figure 7 Dragging fields to the corresponding configuration area
    5. Click Save.

  7. Save the page and preview the effect.

    Figure 8 Checking the background pagination effect