Wijmo dual formatting of one column

1.3k Views Asked by At

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

1

There are 1 best solutions below

3
Ashish On

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';
            }
        }
    }