Hidden column in AG Grid not setting

23 Views Asked by At

I want to return a value to a hidden field based on the value of another field (not hidden) within the same row.

My column definition is this:

    {
        "field": "equiptype",
        "headerName": "Equipment Type",
        "valueGetter": {
            "function": "getEquiptype(params)"
        },
        "hide": true
    }

This is the function:

dagfuncs.getEquiptype = function (params) {
  if (params.data.family) {
    let family = params.data.family.toLowerCase().trim()
    let equiptype = ""
    if (family.includes("123")) {
      equiptype = "A"
    } else {
      equiptype = "B"
    }
    params.data.equiptype = equiptype
    return equiptype
  } else {
    params.data.equiptype = ""
    return ""
  }
}

The value is returned as None when hidden, but returns the correct value if I remove '"hide": true' on equiptype. I've also tried ValueSetter and ValueFormatter when the field is hidden and neither work.

0

There are 0 best solutions below