Horizontal Scrolling requires a width of DataTable to be defined and explicit widths on columns.
+
Flex Scroll
+
In cases where viewport should adjust itself according to the table parent's height instead of a fixed viewport height, set scrollHeight option as flex. In example below, table is inside a Dialog where viewport size dynamically responds to the dialog size changes such as maximizing.
FlexScroll can also be used for cases where scrollable viewport should be responsive with respect to the window size. See the Full Page demo for an example.
In horizontal scrolling, it is required to give fixed widths to columns. In general when customizing the column widths of scrollable tables, use colgroup as below to avoid misalignment issues as it will apply both the header, body and footer sections which are different separate elements internally.
Certain columns can be frozen by using the frozen property of the column component. Widths of the frozen section is specified by the frozenWidth property.
+
Frozen Rows and Columns
+
Certain columns can be frozen by using the frozen property of the column component. Widths of the frozen section is specified by the frozenWidth property.
When using frozen columns with column grouping, use frozenheadergroup and frozenfootergroup types to define grouping for the frozen section.
+
Virtual Scrolling
Virtual scrolling is enabled using virtualScroll and onVirtualScroll properties combined with lazy loading so that data is loaded on the fly during scrolling.
For smooth scrolling twice the amount of rows property is loaded on a lazy load event. In addition, to avoid performance problems row height is not calculated automatically and
should be provided using virtualRowHeight property which defaults to 28px. View the scrolling demo for a sample in-memory implementation.
@@ -2038,7 +2076,7 @@ export default {
scrollHeight
string
null
-
Height of the scroll viewport.
+
Height of the scroll viewport in fixed pixels or the "flex" keyword for a dynamic size.
virtualScroll
diff --git a/src/views/datatable/DataTableFlexScrollDemo.vue b/src/views/datatable/DataTableFlexScrollDemo.vue
new file mode 100644
index 0000000000..2705489572
--- /dev/null
+++ b/src/views/datatable/DataTableFlexScrollDemo.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/datatable/DataTableScrollDemo.vue b/src/views/datatable/DataTableScrollDemo.vue
index 5f93ab1ba7..412b208447 100755
--- a/src/views/datatable/DataTableScrollDemo.vue
+++ b/src/views/datatable/DataTableScrollDemo.vue
@@ -16,6 +16,24 @@
+
Flexible Scroll
+
Flex scroll feature makes the scrollable viewport section dynamic so that it can grow or shrink relative to the parent size of the table.
+ Click the button below to display a maximizable Dialog where data viewport adjusts itself according to the size changes.