Replace a column value in KendoGrid

#1

I;ve KendoGrid with a column for units, when the unit is equal to dimensionless I need to replace it with empty string otherwise keep the current value. I tried using the applyItemConditions helper function for this as follows but it’s seems that when no match is found the function returns null:

            {
                "label": "{~EnergyManagement.MeasurementsListView.unit~}",
                "field": "parent.unitConstraint.id",
                "format": {
                    "funk": "applyItemConditions",
                    "args": [
                        [
                            {
                                "comparator": "==",
                                "comparisonValue": "dimensionless",
                                "conditionalValue": ""
                            }
                        ]
                    ]
                },
                "align": "center",
                "sortable": false,
                "id": "resource"
            }

Is there a format function equivalent to replace (I couldn’t find any under C3.util)?

0 Likes

#2

my bad we already have a replace helper function c3ShowFunc(UIHelper, 'replace').

                "format": {
                    "funk": "replace",
                    "args": [
                        ["dimensionless"],
                        ""
                    ]
                },
0 Likes