Reusable grid

Certified Senior Developer

Hi.

I am attempting to make a reusable grid using a passed ri! of type Any with a cdt type being passed into it.

Optionally I am thinking about passing in a list of column names so I can specify the order the grid displays columns in.

From there I wanted to do a foreach generating the N grid columns using field names and types grabbed from the passed cdt..

1.I don't know if there is a way to get a list of all the fields a cdt type has.

2. I am unsure if there is a way to get their types.

Any tips?  

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to roberts0186

    I think my original suggestion was that you could add a type (or just type id) as a parameter of your reusable component, and call a!keys() on that type reference inside the component.

    For example if you pass a relevant type number (integer), into this code, you get the requested keys: a!keys(cast(6590, {}))

    (6590 is an arbitrary CDT type number in my system, sub out for one of yours, which you can discover with the "typeof" function)

Children