[GH #6603] Handsontable beforechange issue

Tags: #<Tag:0x00007fa98e29d670> #<Tag:0x00007fa98e29c5b8>

Hi

This is now a big issue to me.

In the following code changeTo does not persist into afterChange. This use to work in 6.22 but no longer persists.

The main line being
this.setDataAtRowProp(row, propName, changeTo / 100, “percentChange”);

It seems to go back to the original value when entering afterChange.

Note: the code below is snippets.

beforeChange: function (changes, source) {
if (changes.length === 1 && changes[0][1] != “week”) {
let changeFrom = changes[0][2] || 0;
let changeTo = changes[0][3] || 0;
// If its a check box, the changeDif will be 0 or -1. code is not effected so I haven’t updated the code.
var changeDif = (changeTo) - (changeFrom);

        if (changeDif !== 0) {

if (!!~colformat.indexOf(’%’) && source === “edit”) {
if (changeTo >= 1 || changeTo <= -1) {
this.setDataAtRowProp(row, propName, changeTo / 100, “percentChange”);

            }
          }

}
}

As I understand you are on 7+ now? Can you share the code via demo? It will be much easier to share code samples then copy/paste the code.

Have you got a quick example project in fiddlejs n that I can start with with the latest version 7 handsontables

Here https://jsfiddle.net/AMBudnik/dtwhpry5/ is the latest Handsontable for Angular from the official website https://handsontable.com/docs/7.2.2/frameworks-wrapper-for-angular-simple-example.html

Hi aleksandra_budni

Here is my example of the handsontables error/issue, identical code but on different versions of handsontables.

Change a number to 10 in the table.

6.22
http://jsfiddle.net/jhy3pebt/

7.30
http://jsfiddle.net/bjgqfoh8/1/

Thank you for sharing. It looks like it all changed in 7.0.0
I will investigate this case and come back to you soon.

Hi aleksandra_budnik

Have you had anymore thoughts on this. Could you give me an update on your investigation.

Kind Regards

Ben Warren

I got it!

Previously http://jsfiddle.net/y51tu2mf/ it was a number

and after 7.0.0 http://jsfiddle.net/5Lp0y4e7/ your changeTo becomes a string

Hi

Great.

Does this help me, Is handsontables going to be corrected? what is the next action.

Sorry for the delay. I started a discussion on our Slack to investigate the case but got a few different opinions. I afraid that we will be able to get to the subject after Christimas as now every developer is on a vacation.

Hi, will you be raising this with your stack this week ?

Hey @ben.warren

we had many votes and opinions on the subject but I decided to report this behavior as a bug. It’s reported here https://github.com/handsontable/handsontable/issues/6603

I will update you once we get any news on this subject.