I have a grid using a!gridField which contains a link column. For some of the ro

I have a grid using a!gridField which contains a link column. For some of the rows, the link needs to be hidden. I tried to use following code but the broswer crashs when testing.

a!gridTextColumn(
label: "Name",
data: ri!data,
links: apply(fn(x), ri!data)
)

fn(x): if(isnull(x), null, a!dynamicLink(...))

Instead, if set the link value directly it will work. Any suggestion?

a!gridTextColumn(
label: "Name",
data: ri!data,
links: {null, a!dynamicLink(...), ...}
)

OriginalPostID-139989

OriginalPostID-139989

  Discussion posts and replies are publicly visible

Parents
  • I think if you do this isNull evaluation on the data parameter instead of the links parameter you should be able to hide links in a grid. Ultimately if there is no text value in that grid cell, there will be no link. Here is an example that checks the text array, if the value in that text array is null it will be "" otherwise it will say "Click Here":

    a!gridTextColumn(
    label: local!datasubset.columns[5].label,
    field: local!datasubset.columns[5].field,
    data: if(
    apply(
    rule!notNullOrBlank,
    local!datasubset.data[5].cells.value
    ),
    "Click Here",
    ""
    ),
    alignment: "CENTER",
    links: fn!apply(
    a!documentDownloadLink(
    label: "",
    document: _
    ),
    local!datasubset.data[5].cells.value
    )
    ),
Reply
  • I think if you do this isNull evaluation on the data parameter instead of the links parameter you should be able to hide links in a grid. Ultimately if there is no text value in that grid cell, there will be no link. Here is an example that checks the text array, if the value in that text array is null it will be "" otherwise it will say "Click Here":

    a!gridTextColumn(
    label: local!datasubset.columns[5].label,
    field: local!datasubset.columns[5].field,
    data: if(
    apply(
    rule!notNullOrBlank,
    local!datasubset.data[5].cells.value
    ),
    "Click Here",
    ""
    ),
    alignment: "CENTER",
    links: fn!apply(
    a!documentDownloadLink(
    label: "",
    document: _
    ),
    local!datasubset.data[5].cells.value
    )
    ),
Children
No Data