-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Bug in formula parsing when using nested data structures. #5279
Comments
I was able to fix part of this problem by altering the countColumns function in handsontable.full.js to recursively count the nested columns in the dataset. However, nested formulas still do not work which leads me to believe that the formula parser also needs to be changed so it is recursive as well. For my testing I did the following: First, I added a new function (outside of handsontable because I was just testing fixes) as follows:
Then I modified the countColumns function in handsontable.full.js to use the new function as follows:
I would like to use handsontable with formulas in my new project but without formulas working predictably this won't be an option. Do you have any updates on when the formulas module will be reworked and these problems fixed? |
This issue is closed temporarily. It will be reopened for development as it became a part of New formula plugin task reported at #6466 I will make sure to inform everyone interested in this topic after the official fix. Please feel welcome to makes any comments on this issue. And if you experience similar behavior feel free to contact me at support@handsontable.com |
Hi @GrononS as previously predicted this issue was related to #4430 and both got officially fixed in v9 released today |
Formulas in a JSON data set that appear after nested data do not parse. Formulas that appear prior to the nested data parse correctly.
http://jsfiddle.net/3uryp9zh/2/
If I issue the following command in the debug window the field will still fail to parse and will instead turn red:
hot.setDataAtCell(2, 4, "=SUM(A1:A2)");
If I issue the following two commands in the debug window the formula will parse:
hot.setDataAtCell(2, 4, "=SUM(A1:A1)");
hot.setDataAtCell(2, 4, "=SUM(A1:A2)");
This applies to the handsontable 5 with the latest jQuery library.
Edit: More Info
If I execute the following code it returns true (this is against the first column of the third row)
hot.validateCell("=SUM(A1:A2)", hot.getCellMeta(2, 0), function(a, b, c){console.debug(a)}, null)
But, if I execute the following command on the fifth cell of the third row it returns false
hot.validateCell("=SUM(A1:A2)", hot.getCellMeta(2, 4), function(a, b, c){console.debug(a)}, null)
The formula is valid for both cells so why does if keep failing until I change the value to something else and then back to the formula that was previously failing?
The text was updated successfully, but these errors were encountered: