[GH #9051] Is valid a newValue got from afterFormulasValuesUpdate event?

Tags: #<Tag:0x00007f8b1dd9a3a0> #<Tag:0x00007f8b1dd9a260>

Hi,

I used the Handsontable version 11.0.1. and use afterFormulasValuesUpdate event to capture new value from the cell chage (replace from afterChage event)

I am getting the wrong newValue in change data of afterFormulasValuesUpdate when I am changing the time or text in cell.
eg. input value is 12:30, newValue is 0.520833333333333

I have attached the screen that I have console below:

Hi @duangmee

Thank your for your message. Can you please share code demo with us? It would easier to see what’s going on that way.

Hi @adrian.szymanski,

I can’t upload the .zip file to you.

my example code below :-

import React, { useState, useEffect } from “react”;

import { HotTable } from “@handsontable/react”;

import “handsontable/dist/handsontable.full.css”;

//Apollo

import { HyperFormula } from ‘hyperformula’;

const App = () => {

//var handsontableData = Handsontable.helper.createSpreadsheetData(10000, 100);

let arr_data = [];

let arr_colunm = [];

let get_data = [];

let arr_datas = [];

let arr_head = [];

let arr_columns = [];

let arr_cells = [];

let targetData = 480;

const [hotSettings, setHotSettings] = useState({

licenseKey: "non-commercial-and-evaluation",

hiddenColumns: false,

rowHeights: 26,

manualRowResize: true,

manualColumnResize: true,

manualColumnFreeze: true,

//manualColumnMove: true,

fixedRowsTop: 1,

fixedColumnsLeft: 1,

className: "htRight htMiddle",

// currentRowClassName: 'currentRow',

// currentColClassName: 'currentCol',

// comments: true,

// width: "100%",

height: 300,

formulas: {

  engine: HyperFormula,

},

afterFormulasValuesUpdate: function (changes) {

  //console.log('afterFormulasValuesUpdate -> changes', changes)

  changes.forEach((change) => {

    console.log('afterFormulasValuesUpdate->foreach->change->', change)

  })

},

 

afterChange: function (change, source) {

   console.log('afterChange->change->', change)

},

})

// GET API

useEffect(() => {

  get_data = [

      ['00:00','','',''],

      ['08:00','','',''],

      ['16:00','','',''],

      ['24:00','','','']

      ] ;

    setHotSettings({

      ...hotSettings,

      colHeaders: ['Start Time', 'B', 'Stop Time', 'C'],

      // stretchH: 'all',

      // height: 500,

      columns: [

        {type: 'time', timeFormat: 'HH:mm', correctFormat: true},

        { type: 'numeric',  numericFormat : { pattern : '0,0.00' } },

        {type: 'time', timeFormat: 'HH:mm', correctFormat: true},

        { type: 'numeric',  numericFormat : { pattern : '0,0.00' } }

      ] ,

      data:  get_data

    })

}, []);

const onUpdateData = (time, value, configparam_id) => {

 console.log('TODO: onUpdateData');

}

return (

<div>

   

  {

    <HotTable settings={hotSettings} />

    }

 

</div>

);

};

export default App;

Hi @duangmee

Thank you for sharing the issue report.

You are right. That result is not something we would expect to get. I have reported the issue on our Github board at https://github.com/handsontable/handsontable/issues/9051 and will update you as soon as we fix it.

@aleksandra_budnik,
Thank you for your reply.

1 Like