jQuery Calx just reached version 2.0.3, this release is a hotfix of some bugs known on the previous version, here is the list of the changes made on this release:
- Fix checkbox behaviour, when the checkbox is unchecked, calculation is not updated
- Fix input with % in data-format attribute, so it parse correctly after update and refresh
- Fix refresh and update method, so it works perfectly on dynamic form
- Instalable via bower
bower install jquery-calx
You can grab the latest release here https://github.com/xsanisty/jquery-calx/archive/2.0.3.zip
Please file an issue on github issue tracker if you found any problems when using jQuery Calx:
Let me describe the task. I have 2 inputs with some constants, label with formula and checkbox. When it is checked, formula must take a constant from the first input, otherwise value must be taken from the second input. So what can I do if calculation is stopped due to the checkbox state?
Thanks for this amazing project! But how can I turn off this new feature of checkbox treatment? Only half of the action is available now in a checkbox-driven conditional formula.
Hi Mikhail,
Thanks for the compliment, but I am still unclear on what you mean about the checkbox treatment?
as long as checkbox has data-cell attribute, it will be treated as cell, it just has two states with different value, when unchecked, the value will be 0, else, the value will be the one on value attribute.
regards
Ikhsan
Sorry, first comment was misplaced.
Let me describe the task. I have 2 inputs with some constants, label with formula and checkbox. When it is checked, formula must take a constant from the first input, otherwise value must be taken from the second input. So what can I do if calculation is stopped due to the checkbox state?
Hi Mikhail,
I am sorry if I still don’t understand the problem, how can calculation stopped due to checkbox state?
in the above snippet, A4 will pick A1 or A2 respectively based on the checkbox-A3 state
regards
Ikhsan
Perfect! I’ve tried other variant with the condition “A3>0” and it resulted in “#ERROR!”.
Yes, it seems there is some problem with the token parser, < and > comparative operators resulting a parser error when no whitespace surrounding it, so A3 > 0 should be fine, but A3>0 resulting #ERROR
Yes, spaces did the trick too. Would you kindly help me with another problem? Is it possible to enable recalculation during typing in text boxes?
You can use the following configuration
I thank you kindly for your fast and useful replies!
No problem, and You are welcome 🙂