These are names for the query variables that client use to send as queries. For example sortby is the variable that controls how the returned data are sorted. A topics request with sortby=firstname will expected the data sorted by customer’s first name.
- sortyby: default “sortby”, to define which field would be used for sorting the return data.
- sortreverse: default “sortreverse”, to define if the sorting is reversed.
- fields: default “fields”, to ask for specific columns’ values in the table.
If rowcount is found in the topics request, Genelet will turn on pagination and display searched results in pages:
- rowcount: default “rowcount”, to define how many record in each page
- totalno: default “totalno”, to tell how many records totally in the table
- pageno : default “pageno”, to search specific page by number
- maxpageno: default “maxpageno”, to tell the total pages in the table.
This variable should be setup in component.json for pagination:
- total_force: to decide if the total number of records should be calculated. Default 0, means no calculation.
The web flow of running pagination is:
- Sending a request with rowcount=20 , or manually adding it in Filter, will turn on pagination.
- If no pageno is sent, pageno=1 will be assumed as the default.
- If total_force=1 in the model, the total number of rows and the total number of pages, totalno and maxpageno respectively, will be calculated for pageno=1.
- Use pageno=2 for the second page, and so on.
- sortby should be specifically defined, since the order of rows returned would depend on how they are sorted.
- If totalno is constantly changing in real-time, you should arrange pagination in such a way that the first page, case 2 above, could be clicked often, so as to refresh totalno and maxpageno.