-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DataTable fails to render if columns are mapped and has a static column #959
Comments
@mertsincan can you take a look at it ? |
Of course! |
@mertsincan thanks for the response! is the null check enough? i mean the children will not be checked for the footer now, it might cause some misbehavior now |
Yes, please see;
|
And what if only the mapped columns has footers?
|
You're right! Fixed now! Thanks a lot for the feedback ;) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a ... (check one with "x")
Codesandbox Case (Bug Reports)
The sandbox example showcasing the error can be found in the following link:
https://codesandbox.io/embed/primereact-test-j7j5j
In often cases, tables are created as Components in a bigger application. Those tables are usually have headers generated, so a common use case would be to map some array to Column components like this:
There can be requirements for such table to include either check-able rows, or a column that every table must have, like operations (show and delete).
For the simplicity, in the codesandbox I inlcuded just a new simple column.
Expected behavior
The expected outcome would be, that the table renders normally, including all the mapped columns, and the added extra static column. The order of these should not matter.
Current behavior
Currently the component receives the children objects as array of arrays, instead of a single array, containing all the children.
Code recieves:
But expects the children to be flattened like this:
This causes an exception in
src\components\datatable\DataTable.js:622
that the children object is not flattened, so an array object does not have the
props
property.Minimal reproduction of the problem with instructions
The dome is available on : https://codesandbox.io/embed/primereact-test-j7j5j
Occurs in all version of PrimeReact - tested on commit; e24afe4
Work Around for those that cannot upgrade
There is a possible workaround if you only use 1 array to map, so you need to all the static component to it:
I will submit a pull request with the fix.
The text was updated successfully, but these errors were encountered: