question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DataTable: Column widths get corrupted

See original GitHub issue

Describe the defect In a dataTable with resizable columns, the column width is OK when the table is displayed initially, but gets messed up (made much too small) when refreshing the table one or two times via ajax.

Environment:

  • PF Version: 10.0.1
  • JSF + version: Mojarra 2.3
  • Affected browsers: ALL

To Reproduce

I do not have an example to reproduce, but I debugged the code, and think I discovered the problem.

Please have a look at DataTableRenderer.java line 629 ff.

if (columnMeta != null && columnMeta.getWidth() != null) { width = columnMeta.getWidth(); } When debugging and taking a look at columnMeta.getWidth(), I find cases where it contains the String “null”, not null. As result the width of the respective columns is being set to the String “null”, which leads in the end to corrupted column widths. Please have a look at ColumnMeta.setWidth, and make sure it does not allow setting false content.

For myself, I could fix this at another place in my code, just by fetching the list of ColumnMeta objects from the dataTable, and replacing “null” with null in the width attribute.

Hope my explanation is understandable even without an example.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
tandraschkocommented, May 6, 2021

Please provide a reproducer.

0reactions
mellowarecommented, May 10, 2021

@wlhUser Thanks for reporting this and providing me with the example to fix it. I would have had a tough time reproducing it without it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't figure out why sScrollY corrupts the Columns's size and ...
Looks like you are initialising the table when it is hidden. That means that the elements have no height or width, so it...
Read more >
Column width not working in DataTables bootstrap
I am using the following code to set the column width of a DataTable. During partial page load the width appears to be...
Read more >
DataTable internal index is corrupted: '5'. on - MSDN - Microsoft
I get this error when I've bound a DataTable to a DataGridView, and then I edit the value in the column that the...
Read more >
Frequently Asked Questions (FAQ) - TablePress
Note: In most cases, it is not necessary to set the column widths directly! ... Tables are corrupted and show “[ERROR] TABLE IS...
Read more >
Any form of minColumn width on dxDataGrid will corrupt ...
Any form of minColumn width on dxDataGrid will corrupt column widths ... I don't want to become zero width as the total width...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found