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

cellEdited is triggered when data type changes #4450

Open
stephen-lemp opened this issue Mar 29, 2024 · 3 comments
Open

cellEdited is triggered when data type changes #4450

stephen-lemp opened this issue Mar 29, 2024 · 3 comments

Comments

@stephen-lemp
Copy link

stephen-lemp commented Mar 29, 2024

Website Page
https://tabulator.info/docs/6.2/events#edit

Describe the issue
When data is pre-populated with the "data" element, if a JS Number is set on a text field, the cellEdited event is triggered because Tabulator changes the value to the type that matches the column definition. 1 === '1' is false, so the data changed. If the formatter is set to money (which think should be changed to "Number" or a "Number" formatter should be added, but that's another thought :)) or if the data provided to Tabulator is a string, the cellEdited event doesn't trigger, which is as expected.

The documentation should mention that cellEdited uses strict type checking to determine if a value changed.

https://jsfiddle.net/splemp/fbq63knd/

@olifolkerd
Copy link
Owner

olifolkerd commented Mar 30, 2024

If you use a number editor the type won't change

@stephen-lemp
Copy link
Author

Ok - I just thought that since it threw me off for a little while, some explanation in the documentation would be helpful (since it looks like cellEdited is being triggered when there is no change). If it's not worth noting the docs, this issue could be closed.
Also, thanks so much for your time and effort on this project! It's been immensely helpful.

@olifolkerd
Copy link
Owner

Fair point, I can certainly include some details in the docs

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

2 participants