0

In my Wijmo FlexGrid, in one Dropdown Column having dropdown values (decimal, Percentage). I need to show percentage symbol if I choose percentage as dropdown values, and decimal (n2) if Dropdown value is selected decimal

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
S.L.
  • 23
  • 5

1 Answers1

0

You need to set the format of the column based on the value using itemFormatter or formatItem event. Here is a fiddle demonstrating similar requirement: http://jsfiddle.net/5Ltfpzst/

 grid.itemFormatter = function (panel, r, c, cell) {
        if (panel.cellType === wijmo.grid.CellType.Cell && c == 3) {

            var cellData = panel.getCellData(r, 0);
            if (cellData < 5) {
                panel.columns[c].format = 'n1';
            } else {
                panel.columns[c].format = 'p0';
            }
        }
    }
Ashish
  • 594
  • 1
  • 6
  • 12
  • I have tried in the same way..But in this case I wont be able to edit value. If I double click on the cell,it immediately comes out. – S.L. Jul 15 '15 at 09:05
  • I think this issue is already being discussed on the following thread:http://wijmo.com/topic/condition-base-formating-on-same-cell/ – Ashish Jul 16 '15 at 08:25
  • Is it possible to apply the same formatting on loaded-rows event? – Abu Sufyan Jan 23 '17 at 13:46