Tabla virtualizada beta

Along with evolutionary web development, table component has always been the most popular component in our web apps especially for dashboards, data analysis. For Table V1, with even just 1000 records of data, it can be very annoying when using it, because of the poor performance.

Con la Tabla Virtualizada, puede renderizar masivos trozos de datos en un parpadeo de ojos.

TIP

Este componente todavía está bajo prueba, úselo bajo su propio riesgo. If you find any bugs or issues, please report them at GitHub for us to fix. Also there were some APIs which are not mentioned in this documentation, some of them were not fully developed yet, which is why they are not mentioned here.

Even though Virtualized Table is efficient, when the data load is too large, your network and memory size can become the bottleneck of your app. So keep in mind that Virtualized Table is never the ultimate solution for everything, consider paginating your data, adding filters etc.

Uso básico

Let's demonstrate the performance of the Virtualized Table by rendering a basic example with 10 columns and 1000 rows.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Auto redimensionar

When you do not want to manually pass the width and height properties to the table, you can wrap the table component with the AutoResizer. This will automatically update the width and height for you.

Redimensione su navegador para ver cómo funciona.

TIP

Make sure the parent node of the AutoResizer HAS A FIXED HEIGHT, since its default height value is set to 100%. Alternatively, you can define it by passing the style attribute to AutoResizer.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9

Personalizar el procesador de celdas

Of course, you can render the table cell according to your needs. Here's a simple example of how to customize your cell.

Tom
Tom
Tom
Tom
Tom
Tom
Tom
Tom
Tom
Name
Operations
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
Date

Tabla con selecciones

Utilizando el renderizador de celdas personalizado para permitir la selección para la tabla.

Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 0 - Col 10
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 1 - Col 10
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 2 - Col 10

Edición en línea

Just as we demonstrated with selections above, you can use the same method to enable inline editing.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9

Tabla con estado

Puede destacar su contenido de tabla para distinguir entre "success, information, warning, danger" y otros estados.

To customize the appearance of rows, use the row-class-name attribute. For example, every 10th row is highlighted using the bg-blue-200 class, and every 5th row with the bg-red-100 class.

Tom
Tom
Tom
Tom
Tom
Tom
Tom
Tom
Tom
Name
Operations
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
2020/10/01
Date

Tabla con filas pegajosas

You can make some rows stick to the top of the table, and that can be very easily achieved by using the fixed-data attribute.

You can dynamically set the sticky row based on scroll events, as shown in this example.

Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9
Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9

Tabla con columnas fijas

If you want to have columns stick to the left or right for some reason, you can achieve this by adding special attributes to the table.

Puede establecer el atributo de la columna fixed a true (representando con FixedDir.LEFT) o FixedDir.LEFT o FixedDir.RIGHT

Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Row 0 - Col 0
Row 0 - Col 1
Row 1 - Col 0
Row 1 - Col 1
Row 2 - Col 0
Row 2 - Col 1
Row 3 - Col 0
Row 3 - Col 1
Row 4 - Col 0
Row 4 - Col 1
Row 5 - Col 0
Row 5 - Col 1
Row 6 - Col 0
Row 6 - Col 1
Row 7 - Col 0
Row 7 - Col 1
Row 8 - Col 0
Row 8 - Col 1
Column 0
Column 1
Row 0 - Col 9
Row 1 - Col 9
Row 2 - Col 9
Row 3 - Col 9
Row 4 - Col 9
Row 5 - Col 9
Row 6 - Col 9
Row 7 - Col 9
Row 8 - Col 9
Column 9

Encabezado de grupo

By customizing your header renderer, you can group your header as shown in this example.

TIP

In this case we used JSX feature which is not supported in the playground. You may try them out in your local environment or on online IDEs such as codesandbox.

Se recomienda que escriba el componente de tabla en JSX, ya que contiene manipulaciones de VNode.

Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 0 - Col 10
Row 0 - Col 11
Row 0 - Col 12
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 1 - Col 10
Row 1 - Col 11
Row 1 - Col 12
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 2 - Col 10
Row 2 - Col 11
Row 2 - Col 12
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 3 - Col 10
Row 3 - Col 11
Row 3 - Col 12
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 4 - Col 10
Row 4 - Col 11
Row 4 - Col 12
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 5 - Col 10
Row 5 - Col 11
Row 5 - Col 12
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 6 - Col 10
Row 6 - Col 11
Row 6 - Col 12
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 7 - Col 10
Row 7 - Col 11
Row 7 - Col 12
Group width 400
Group width 400
Group width 200
Group width 200
Group width 200
Group width 200
Group width 200
Group width 200
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9
Column 10
Column 11
Column 12
Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Group width 300
Group width 200
Group width 100
Column 0
Column 1
Column 2
Row 0 - Col 13
Row 0 - Col 14
Row 1 - Col 13
Row 1 - Col 14
Row 2 - Col 13
Row 2 - Col 14
Row 3 - Col 13
Row 3 - Col 14
Row 4 - Col 13
Row 4 - Col 14
Row 5 - Col 13
Row 5 - Col 14
Row 6 - Col 13
Row 6 - Col 14
Row 7 - Col 13
Row 7 - Col 14
Group width 200
Group width 200
Column 13
Column 14

Filtros

Virtualized Table provides custom header renderers for creating customized headers. We can then utilize these to render filters.

Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9
Row 0 - Col 0
Row 0 - Col 1
Row 1 - Col 0
Row 1 - Col 1
Row 2 - Col 0
Row 2 - Col 1
Row 3 - Col 0
Row 3 - Col 1
Row 4 - Col 0
Row 4 - Col 1
Row 5 - Col 0
Row 5 - Col 1
Row 6 - Col 0
Row 6 - Col 1
Row 7 - Col 0
Row 7 - Col 1
Row 8 - Col 0
Row 8 - Col 1
Column 0
Column 1

Ordenable

Puede ordenar la tabla con el estado de ordenación.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Orden controlado

You can define multiple sortable columns as needed. Keep in mind that if you define multiple sortable columns, the UI may appear confusing to your users, as it becomes unclear which column is currently being sorted.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Intervalo cruzado

When dealing with a large list, it's easy to lose track of the current row and column you are visiting. In such cases, using this feature can be very helpful.

Colspan

The virtualized table doesn't use the built-in table element, so colspan and rowspan behave a bit differently compared to TableV1. However, with a customized row renderer, these features can still be implemented. In this section, we'll demonstrate how to achieve this.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Rowspan

Since we have covered Colspan, it's worth noting that we also have row span. It's a little bit different from colspan but the idea is basically the same.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Rowspan y Colspan juntos

¡Podemos combinar rowspan y colspan para alcanzar el objetivo de negocio!

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 1
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 1
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 1
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 1
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Datos con formato de árbol

Virtual Table can also render data in a tree-like structure. By clicking the arrow icon, you can expand or collapse the tree nodes.

Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Row 0 - Col 0
Row 0 - Col 1
Row 1 - Col 0
Row 1 - Col 1
Row 2 - Col 0
Row 2 - Col 1
Row 3 - Col 0
Row 3 - Col 1
Row 4 - Col 0
Row 4 - Col 1
Row 5 - Col 0
Row 5 - Col 1
Row 6 - Col 0
Row 6 - Col 1
Row 7 - Col 0
Row 7 - Col 1
Row 8 - Col 0
Row 8 - Col 1
Column 0
Column 1
Row 0 - Col 9
Row 1 - Col 9
Row 2 - Col 9
Row 3 - Col 9
Row 4 - Col 9
Row 5 - Col 9
Row 6 - Col 9
Row 7 - Col 9
Row 8 - Col 9
Column 9

Filas de altura dinámica

Virtual Table is capable of rendering rows with dynamic heights. If you're working with data and are uncertain about the content size, this feature is ideal for rendering rows that adjust to the content's height. To enable this, pass down the estimated-row-height attribute. The closer the estimated height matches the actual content, the smoother the rendering experience.

TIP

Each row's height is dynamically measured during rendering the rows. As a result, if you're trying to display a large amount of data, the UI might be bouncing.

Tom
Eius optio fugiat.
Tom
Corrupti doloremque a quos vero delectus consequatur.
Tom
Corrupti doloremque a quos vero delectus consequatur.
Tom
Corrupti doloremque a quos vero delectus consequatur.
Tom
Corrupti doloremque a quos vero delectus consequatur.
Tom
Corrupti doloremque a quos vero delectus consequatur.
Tom
Quaerat ipsam necessitatibus eum quibusdam est id voluptatem cumque mollitia.
Tom
Corrupti doloremque a quos vero delectus consequatur.
Tom
Quaerat ipsam necessitatibus eum quibusdam est id voluptatem cumque mollitia.
Tom
Corrupti doloremque a quos vero delectus consequatur.
Tom
Eius optio fugiat.
Name
Description
Operations
random-200
random-199
random-198
random-197
random-196
random-195
random-194
random-193
random-192
random-191
random-190
Id

Vista de detalle

Using dynamic height rendering, you can also display a detailed view within the table.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Pie personalizado

Render a customized footer when you want to show a concluding message or information.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Row 9 - Col 0
Row 9 - Col 1
Row 9 - Col 2
Row 9 - Col 3
Row 9 - Col 4
Row 9 - Col 5
Row 9 - Col 6
Row 9 - Col 7
Row 9 - Col 8
Row 9 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Renderizado personalizado de vacío

Render a customized empty element.

Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

No Data

Overlay

Render an overlay on top of the table when you want to show a loading indicator or something else.

Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9
Row 3 - Col 0
Row 3 - Col 1
Row 3 - Col 2
Row 3 - Col 3
Row 3 - Col 4
Row 3 - Col 5
Row 3 - Col 6
Row 3 - Col 7
Row 3 - Col 8
Row 3 - Col 9
Row 4 - Col 0
Row 4 - Col 1
Row 4 - Col 2
Row 4 - Col 3
Row 4 - Col 4
Row 4 - Col 5
Row 4 - Col 6
Row 4 - Col 7
Row 4 - Col 8
Row 4 - Col 9
Row 5 - Col 0
Row 5 - Col 1
Row 5 - Col 2
Row 5 - Col 3
Row 5 - Col 4
Row 5 - Col 5
Row 5 - Col 6
Row 5 - Col 7
Row 5 - Col 8
Row 5 - Col 9
Row 6 - Col 0
Row 6 - Col 1
Row 6 - Col 2
Row 6 - Col 3
Row 6 - Col 4
Row 6 - Col 5
Row 6 - Col 6
Row 6 - Col 7
Row 6 - Col 8
Row 6 - Col 9
Row 7 - Col 0
Row 7 - Col 1
Row 7 - Col 2
Row 7 - Col 3
Row 7 - Col 4
Row 7 - Col 5
Row 7 - Col 6
Row 7 - Col 7
Row 7 - Col 8
Row 7 - Col 9
Row 8 - Col 0
Row 8 - Col 1
Row 8 - Col 2
Row 8 - Col 3
Row 8 - Col 4
Row 8 - Col 5
Row 8 - Col 6
Row 8 - Col 7
Row 8 - Col 8
Row 8 - Col 9
Row 9 - Col 0
Row 9 - Col 1
Row 9 - Col 2
Row 9 - Col 3
Row 9 - Col 4
Row 9 - Col 5
Row 9 - Col 6
Row 9 - Col 7
Row 9 - Col 8
Row 9 - Col 9
Row 10 - Col 0
Row 10 - Col 1
Row 10 - Col 2
Row 10 - Col 3
Row 10 - Col 4
Row 10 - Col 5
Row 10 - Col 6
Row 10 - Col 7
Row 10 - Col 8
Row 10 - Col 9
Column 0
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9

Desplazamiento manual

Use the methods provided by Table V2 to scroll manually/programmatically with desired offset/rows.

TIP

El segundo parámetro para scrollToRow es la estrategia de desplazamiento que por defecto es auto, calcula la posición para desplazarse por sí misma. If you wish to scroll to a specific position, you can define the strategy yourself. Las opciones disponibles son "auto" | "center" | "end" | "start" | "smart"

La diferencia entre smart y auto es que auto es un subconjunto de la estrategia de desplazamiento smart.

Scroll pixels
Scroll rows
Row 0 - Col 0
Row 0 - Col 1
Row 0 - Col 2
Row 0 - Col 3
Row 0 - Col 4
Row 0 - Col 5
Row 0 - Col 6
Row 0 - Col 7
Row 0 - Col 8
Row 0 - Col 9
Row 1 - Col 0
Row 1 - Col 1
Row 1 - Col 2
Row 1 - Col 3
Row 1 - Col 4
Row 1 - Col 5
Row 1 - Col 6
Row 1 - Col 7
Row 1 - Col 8
Row 1 - Col 9
Row 2 - Col 0
Row 2 - Col 1
Row 2 - Col 2
Row 2 - Col 3
Row 2 - Col 4
Row 2 - Col 5
Row 2 - Col 6
Row 2 - Col 7
Row 2 - Col 8
Row 2 - Col 9

Atributos de TableV2

NombreDescripciónTipoPor defecto
cacheNumber of rows rendered in advance to boost the performanceNumber2
estimated-row-heightLa altura estimada de fila para renderizar filas de altura dinámicaNumber
header-classNombre de clase personalizado pasado al envoltorio de cabeceraString/Function<HeaderClassGetter>
header-propsNombre de las propiedades personalizadas pasadas al componente de cabeceraObject/Function<HeaderPropsGetter>
header-cell-propsNombre de las propiedades personalizadas pasadas al componente de celdas de la cabeceraObject/Function<HeaderCellPropsGetter>
header-heightThe height of the header is set by height. If given an array, it renders header rows equal to its lengthNumber/Array<Number>50
footer-heightThe height of the footer element, when provided, will be part to the calculation of the table's height.Number0
row-classNombre de clase personalizado pasado al envoltorio de filaString/Function<RowClassGetter>
row-keyThe key of each row, if not provided, will be the index of the rowString/Symbol/Numberid
row-propsNombre de las propiedades personalizadas pasadas al componente de filaObject/Function<RowPropsGetter>
row-heightLa altura de cada fila, utilizada para calcular la altura total de la tablaNumber50
cell-propspropiedades adicionales pasados a cada célula (excepto las células de la cabecera)Object/Function<CellPropsGetter>
columnsUn array de definiciones de columnas.Array<Column>
dataUna matriz de datos a procesar en la tabla.Array<Data>[]
data-getterA method to customize data fetch from the data source.Function
fixed-dataDatos para procesar filas sobre el contenido principal y debajo del encabezadoArray<Data>
expand-column-keyLa clave de columna que indica qué fila se puede expandirString
expanded-row-keysUn array de claves para filas expandidas, puede utilizarse con v-modelArray<KeyType>
default-expanded-row-keysUn array de claves para filas expandidas por defecto, NO REACTIVEArray<KeyType>
classClass name for the virtual table, will be applied to all three tables (left, right, main)String/Array/Object
fixedFlag indicates the table column's width to be fixed or flexible.Booleanfalse
width requiredWidth of the tableNumber
height requiredHeight of the tableNumber
max-heightMaximum height of the tableNumber
h-scrollbar-sizeIndica el tamaño de la barra de desplazamiento horizontal para la tabla, utilizada para prevenir el colapso de la barra de desplazamiento horizontal y verticalNumber6
v-scrollbar-sizeIndica el tamaño de la barra de desplazamiento vertical para la tabla, utilizada para prevenir el colapso de la barra de desplazamiento horizontal y verticalNumber6
scrollbar-always-onSi se activa, la barra de desplazamiento siempre se mostrará en lugar de cuando el ratón se coloca encima de la tablaBooleanfalse
sort-byIndicador de ordenObject<SortBy>{}
sort-stateMúltiples indicadores de ordenaciónObject<SortState>undefined

Slots de TableV2

NombreParámetros
cellCellSlotProps
headerHeaderSlotProps
header-cellHeaderCellSlotProps
rowRowSlotProps
footer
empty
overlay

Eventos de TableV2

NombreDescripciónParámetros
column-sortSe invoca cuando la columna está ordenadaObject<ColumnSortParam>
expanded-rows-changeInvocado cuando las filas expandidas cambianArray<KeyType>
end-reachedInvocado cuando se alcanza el final de la tabla
scrollInvoked after scrollingObject<ScrollParams>
rows-renderedInvocado cuando las filas son procesadasObject<RowsRenderedParams>
row-expandSe invoca cuando se expande/contrae el nodo del árbol haciendo clic en el icono de la flechaObject<RowExpandParams>
row-event-handlersUna colección de manejadores conectados a cada filaObject<RowEventHandlers>

Métodos TableV2

NombreDescripciónParámetros
scrollToDesplazar a una posición determinada{ scrollLeft?: number, scrollTop?: number}
scrollToLeftDesplazar a una posición horizontal determinadascrollLeft: number
scrollToTopDesplazar a una posición vertical dadascrollTop: number
scrollToRowdesplazar a una fila determinada con la estrategia de desplazamiento especificadarow: number, strategy?: "auto" |"center" | "end" | "start" | "smart"

TIP

Note that these are JavaScript Objects, so you CANNOT USE kebab-case for these attributes

Atributos de columna

NombreDescripciónTipoPor defecto
alignAlineación del contenido de la celdaAlignmentleft
classNombre de la clase para la columnaString
keyUnique identificationKeyType
dataKeyUnique identification of dataKeyType
fixedDirección fija de la columnaBoolean/FixedDirfalse
flexGrowCSSProperties flex grow, Only useful when this is not a fixed tableNumber0
flexShrinkCSSProperties flex shrink, Only useful when this is not a fixed tableNumber1
headerClassUtilizado para personalizar la clase de columna de cabeceraString
hiddenSi la columna es invisibleBoolean
styleEstilo personalizado para la celda de columna, se fusionará con celda de cuadrículaCSSProperties
sortableIndica si la columna es ordenableBoolean
titleEl texto por defecto renderizado en la celda de cabeceraString
maxWidthAncho máximo para la columnaNumber
minWidthAncho mínimo para la columnaNumber
width requiredWidth for the columnNumber
cellRendererRenderizado personalizado de celdasVueComponent/(props: CellRenderProps) => VNode
headerCellRendererRenderizado personalizado de cabeceraVueComponent/(props: HeaderRenderProps) => VNode

Typings

Mostrar Declaraciones de Tipo
ts
type HeaderClassGetter = (param: {
  columns: Column<any>[]
  headerIndex: number
}) => string

type HeaderPropsGetter = (param: {
  columns: Column<any>[]
  headerIndex: number
}) => Record<string, any>

type HeaderCellPropsGetter = (param: {
  columns: Column<any>[]
  column: Column<any>
  columnIndex: number
  headerIndex: number
  style: CSSProperties
}) => Record<string, any>

type RowClassGetter = (param: {
  columns: Column<any>[]
  rowData: any
  rowIndex: number
}) => string

type RowPropsGetter = (param: {
  columns: Column<any>[]
  rowData: any
  rowIndex: number
}) => Record<string, any>

type CellPropsGetter = (param: {
  column: Column<any>
  columns: Column<any>[]
  columnIndex: number
  cellData: any
  rowData: any
  rowIndex: number
}) => void

type CellRenderProps<T> = {
  cellData: T
  column: Column<T>
  columns: Column<T>[]
  columnIndex: number
  rowData: any
  rowIndex: number
}

type HeaderRenderProps<T> = {
  column: Column<T>
  columns: Column<T>[]
  columnIndex: number
  headerIndex: number
}

type ScrollParams = {
  xAxisScrollDir: 'forward' | 'backward'
  scrollLeft: number
  yAxisScrollDir: 'forward' | 'backward'
  scrollTop: number
}

type CellSlotProps<T> = {
  column: Column<T>
  columns: Column<T>[]
  columnIndex: number
  depth: number
  style: CSSProperties
  rowData: any
  rowIndex: number
  isScrolling: boolean
  expandIconProps?:
    | {
        rowData: any
        rowIndex: number
        onExpand: (expand: boolean) => void
      }
    | undefined
}

type HeaderSlotProps = {
  cells: VNode[]
  columns: Column<any>[]
  headerIndex: number
}

type HeaderCellSlotProps = {
  class: string
  columns: Column<any>[]
  column: Column<any>
  columnIndex: number
  headerIndex: number
  style: CSSProperties
  headerCellProps?: any
  sortBy: SortBy
  sortState?: SortState | undefined
  onColumnSorted: (e: MouseEvent) => void
}

type RowCommonParams = {
  rowData: any
  rowIndex: number
}

type RowEventHandlerParams = {
  rowKey: KeyType
  event: Event
} & RowCommonParams

type RowEventHandler = (params: RowEventHandlerParams) => void
type RowEventHandlers = {
  onClick?: RowEventHandler
  onContextmenu?: RowEventHandler
  onDblclick?: RowEventHandler
  onMouseenter?: RowEventHandler
  onMouseleave?: RowEventHandler
}

type RowsRenderedParams = {
  rowCacheStart: number
  rowCacheEnd: number
  rowVisibleStart: number
  rowVisibleEnd: number
}

type RowSlotProps = {
  columns: Column<any>[]
  rowData: any
  columnIndex: number
  rowIndex: number
  data: any
  key: number | string
  isScrolling?: boolean
  style: CSSProperties
}

type RowExpandParams = {
  expanded: boolean
  rowKey: KeyType
} & RowCommonParams

type Data = {
  [key: KeyType]: any
  children?: Array<any>
}

type FixedData = Data

type KeyType = string | number | symbol

type ColumnSortParam<T> = { column: Column<T>; key: KeyType; order: SortOrder }

enum SortOrder {
  ASC = 'asc',
  DESC = 'desc',
}

type SortBy = { key: KeyType; Order: SortOrder }
type SortState = Record<KeyType, SortOrder>

FAQs

How do I render a list with a checkbox in the first column?

Since you are allowed to define your own cell renderer, you can do what the example Customize Cell Renderer did to render checkbox yourself, and maintain the state by yourself.

Why does virtualized table provide less features than TableV1

For virtualized table, we intend to provide less feature and let our users implement their own features as needed. Integrar demasiadas características hace que el código sea difícil de mantener y para la mayoría de los usuarios las características básicas son suficientes. Algunas características clave aún no han sido desarrolladas. ¡Queremos saber tu opinión! Únete a Discord para estar atento.

Fuente

ComponentesStyleDocumentación

Contribuidores