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

Not able to avoid formula #102

Closed
tbnovaes opened this issue Feb 8, 2018 · 2 comments
Closed

Not able to avoid formula #102

tbnovaes opened this issue Feb 8, 2018 · 2 comments

Comments

@tbnovaes
Copy link

tbnovaes commented Feb 8, 2018

I don't want to allow people to type formulas on the cell. It has to be numbers only. However if the person type =, formula is invoked automatically and there is no way I could find to avoid it.

Also the formula function has 2 console.log() logging the values of each cell

@pphod
Copy link
Contributor

pphod commented Feb 8, 2018

Yes, if = is typed they are trying to invoke that. But you could try to remove than with the updateSettings that happens every time a column is changed.

https://bossanova.uk/jexcel/examples/currency-and-masking-numbers

About the console.log this was updated in the master repository and you can get the new version without it.

@pphod pphod closed this as completed Feb 8, 2018
@tbnovaes
Copy link
Author

tbnovaes commented Feb 9, 2018

yes I can use the updateSettings, however it is called after the cell has invoked the formula, so I will have the value changed to the one I want, but I'll have and error on my console too.

I think best place to handle this type of validation would be on onbeforechange(), so I could take care of making any value validation and replacement before it take place.

However, even tho I could validate it on onbeforechange(), I have not found a way to replace the value on the cell. My idea is, if the value is valid, keep the value, if not valid then replace the new value with the old value.

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