-
Notifications
You must be signed in to change notification settings - Fork 754
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
cannot read property 'replace' of undefined #1151
Comments
Hi @ashish-bhanderi! The natural sort function only accepts strings. There is a note at the start of the function:
If you're seeing an error, then the first column in your table must be parsing values... please make sure that a "text" parser is being used. |
I am applying sorting on text fields only. So, For the first iteration it should compare "BBB" and "ddd". Instead of that it is doing below thing. That's why I am asking to put below condition |
Would you please modify this demo so that it duplicates this error. Sorry, I am being stubborn, because the natural sort function is used a lot while sorting and any extra code means it slows down that much more... it may not be noticeable in small tables in Chrome, but try a large table in Internet Explorer. Once I have time to integrate clusterize into the code, it may not be much of an issue anymore. |
Any update on this issue? |
I found other solution. |
Hey @ashish-bhanderi! what solution did you find? I have the same problem for empty rows.. |
Hi @roctoll I'm not sure why you're getting an undefined error, but ok ok I give in... I'll add a fix to fallback to an empty string, but I still don't think I need to add a |
Had the same problem. |
When I applied sorting on first column which contains text,
At that time it gives an error "cannot read property 'replace' of undefined" in function sortNatural
Line no: 1760
aNum = a.replace( regex.chunk, '\0$1\0' ).replace( regex.chunks, '' ).split( '\0' );
because variable a is undefined.
Can you please put condition over-there?
The text was updated successfully, but these errors were encountered: