Wijmo Flexgrid Decimal data getting round off

1.4k Views Asked by At

In my Wijmo FlexGrid, in one Column I have Decimal Value (32.786878). In the UI its getting round off.

I want to show Round off (32.79) value only in UI, but when I edit column value in UI, I want to display full value (32.786878)

1

There are 1 best solutions below

2
On BEST ANSWER

You can set the format of the column as 'n2' and then, set the raw value as editor's value in the prepareCellForEdit event like this:

grid.prepareCellForEdit.addHandler(function (s, e) {
      if (e.col == 3) {
          var unFormattedData = s.getCellData(e.row, e.col, false);
          s.activeEditor.value = unFormattedData;
      }
  });

Here is the fiddle: http://jsfiddle.net/q7z3hpjq/