Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table: Use data mapping object instead of merging values #701

Open
mlmoravek opened this issue Dec 22, 2023 · 0 comments · May be fixed by #919
Open

Table: Use data mapping object instead of merging values #701

mlmoravek opened this issue Dec 22, 2023 · 0 comments · May be fixed by #919
Labels
bug Something isn't working enhancement New feature or request

Comments

@mlmoravek
Copy link
Member

Overview of the problem

Oruga version: [0.8.X]

Description

In the current implementation of the table component, each element of the table data property (which is a user-defined array) is extended by a special identifier to implement specific behaviour of the table.

But this is a bad concept. It also results in unexpected behaviour for some users.

We shouldn't be touching the data props to set or recreate data.
We can resolve it without using an Object.assign to avoid cloning each row.
We can use an object map where the key is the row and the value is uuid.
Or table data is an array of our class/interfaces,

interface TableData { 
  key: any;
  data: any[];
}

In the future

TableData<T> {
  id: any;
  data: T[];
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant