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

Got error if there are some invisible columns #7

Open
cungobu opened this issue Mar 24, 2022 · 3 comments
Open

Got error if there are some invisible columns #7

cungobu opened this issue Mar 24, 2022 · 3 comments

Comments

@cungobu
Copy link

cungobu commented Mar 24, 2022

I got an issue when some columns in my table are invisible which can be set by
columnDefs: [ { targets: [0, 1], visible: false }]
or
columns: [{ title: 'Customer Name', data: 'Name', visible: false }]

I'm using colResize with saveState = true. It's ok for the first time but since the next time I got the error like this
Uncaught TypeError: Cannot read properties of null (reading 'match')
from the line
column.sWidth.match(/(\d+)/i)
as sWidth was undefined which could be caused by calculating the width of an invisible DOM.

Actually, we can check null / undefined then skip & continue with visible columns because we do not need to resize invisible columns.

@cungobu cungobu changed the title Throw error if there are some invisible columns Got error if there are some invisible columns Mar 24, 2022
pafernandez-oesia added a commit to pafernandez-oesia/datatables.colResize that referenced this issue Jun 7, 2022
Don't need to resize invisible cols, as user cungobu pointed.
@hchiam
Copy link
Contributor

hchiam commented Jul 15, 2022

I saw this too. Just adding a screenshot of the bug in a production app:
screenshot-of-production-bug

dhobi pushed a commit that referenced this issue Jan 4, 2023
Don't need to resize invisible cols, as user cungobu pointed.
@dhobi
Copy link
Owner

dhobi commented Jan 4, 2023

Merged and published. Please recheck with v1.7.1 and close the issue if resolved.

@hchiam
Copy link
Contributor

hchiam commented Jan 5, 2023

Looks like the PR #11 fixed the original error message! 🎉

But now I see another error message coming from within the _fnShowMaxBoundReached function. If you still have the console open and refresh the "AFTER" demo, there's now an Uncaught TypeError: Cannot read properties of null (reading 'addClass') ❌ 😢

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants