|
@@ -201,3 +201,22 @@ def more() -> None:
|
|
|
table.toggle_fullscreen()
|
|
|
button.props('icon=fullscreen_exit' if table.is_fullscreen else 'icon=fullscreen')
|
|
|
button = ui.button('Toggle fullscreen', icon='fullscreen', on_click=toggle).props('flat')
|
|
|
+
|
|
|
+ @text_demo('Pagination', '''
|
|
|
+ You can provide either a single integer or a dictionary to define pagination.
|
|
|
+ ''')
|
|
|
+ def pagination() -> None:
|
|
|
+ columns = [
|
|
|
+ {'name': 'name', 'label': 'Name', 'field': 'name', 'required': True, 'align': 'left'},
|
|
|
+ {'name': 'age', 'label': 'Age', 'field': 'age', 'sortable': True},
|
|
|
+ ]
|
|
|
+ rows = [
|
|
|
+ {'name': 'Elsa', 'age': 18},
|
|
|
+ {'name': 'Oaken', 'age': 46},
|
|
|
+ {'name': 'Hans', 'age': 20},
|
|
|
+ {'name': 'Sven'},
|
|
|
+ {'name': 'Olaf', 'age': 4},
|
|
|
+ {'name': 'Anna', 'age': 17},
|
|
|
+ ]
|
|
|
+ ui.table(columns=columns, rows=rows, pagination=3)
|
|
|
+ ui.table(columns=columns, rows=rows, pagination={'rowsPerPage': 4, 'sortBy': 'age', 'page': 2})
|