2

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)

Nilay Vishwakarma
  • 3,105
  • 1
  • 27
  • 48
S.L.
  • 23
  • 5

1 Answers1

2

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/

Ashish
  • 594
  • 1
  • 6
  • 12
  • Hi this solve the problem...but one issue here is column is percentage..so can I have two format p0 and n1 together – S.L. May 19 '15 at 12:35
  • If you want to have percentage values with one decimal then you can set format as 'p1'. I don't think you can apply two formats on same column. – Ashish May 20 '15 at 05:51