Show value instead of formula when double click on cell

Tags: #<Tag:0x00007efc6556fa28>

Hi @aleksandra_budnik

In this example, https://jsfiddle.net/handsoncode/7ahrn89z/1, double-clicking on column C shows “=B1+10”. But is it possible to show the actual value itself which is “12” instead of formula?

I am setting the formula dynamically to a set of columns using the setDataAtCell method, but after the table has rendered on double click I want the actual value to be shown in the cell instead of formula. Is there any way to achieve this?

Thanks in Advance.

Hey @rafi.rob231

The formula is a reference so what you can do is break the reference. Here’s an example https://jsfiddle.net/AMBudnik/a3xf56cu/

@aleksandra_budnik thank you for the response that was helpful. is there any hook which triggers for double clicking on a cell?

similar to this one

          log('dbClickCell ' + row + ' ' + col);
          console.log(instance.getDataAtCell(row, col));
        }```

There’s no dbclick provided by Handsontable, but there’s a native event https://developer.mozilla.org/en-US/docs/Web/API/Element/dblclick_event

Thanks @aleksandra_budnik

I have observed that afterSetDataAtCell hook is getting fired twice. is it usual behavior or I am missing anything?

It shouldn’t. Here https://jsfiddle.net/AMBudnik/15tv2uxs/ when I change anything in a cell it is fired once. I’ve tested it on Chrome 75/ Mac Mojave

Thanks @aleksandra_budnik, I found the issue it was my code. my bad.

Glad to hear that the issue’s gone.

I think that we can close the thread.