njleonzhang / vue-data-tables

A simple, customizable and pageable table with SSR support, based on vue2 and element-ui

Home Page:https://njleonzhang.github.io/vue-data-tables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lazy loading tree data

stefanknegt opened this issue · comments

Online reproduce

https://codepen.io/steeviek/pen/yLNJWVP

Expected Behavior

The rows are expandable and the load method is called to show the tree data.

Current Behavior

Unable to expand the rows when 'children' arrays are empty in the beginning. However, I want to be able to lazy load the children rows, just like in Element-UI (see https://element.eleme.io/#/en-US/component/table).

Steps to Reproduce

Open the codepen and you will see it is not possible to expand the last row, while it has the children property set.

Detailed Description

In Element-UI you can set lazy to true and then lazy load the data of the expanding rows when a row is expanded. However, I am unable to expand a row with this package when there are no children set on initial load.

It was my mistake, sorry. For future reference: you need to set lazy to true in the tableProps and not on the table itself and set the right row-key in the tableProps.