3 Separate Grids but the same CDT

Hi, 

I am able to create an editable grid. In order to separate the rows by type, I have created 3 grids on the same interface that are linked to the same CDT. How can I create filters so that the data displayed on each grid will be of a certain type? 

The hard bit then, is when I select "remove row", how can I best manage the index so it deletes the correct row?

I am using a!forEach to create the grid following the Appian recipes. 

Many thanks, 

Eric

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi Eric,

    1. How can I create filters so that the data displayed on each grid will be of a certain type?

    As lukasm0001 mentioned, you can set unique showWhen logic on each of your grids to act as your "filter", only showing the types of data you want for each grid.

    Alternatively, you can use index(wherecontains()) to store filtered sets of your data into local with() variables, and pass in those data sets into your grids.

    2. The hard bit then, is when I select "remove row", how can I best manage the index so it deletes the correct row?

    It sounds like what you're going to want here is wherecontains(). This will allow you to determine the index in your main unfiltered array for the element that exists in one of your filtered arrays. Once you have this index, you may proceed to remove that element as you design. If your CDTs are backed by tables, the best practice would be to set an "isActive" flag to false for that element, rather than simply removing it from your data set.

Reply
  • 0
    Certified Lead Developer

    Hi Eric,

    1. How can I create filters so that the data displayed on each grid will be of a certain type?

    As lukasm0001 mentioned, you can set unique showWhen logic on each of your grids to act as your "filter", only showing the types of data you want for each grid.

    Alternatively, you can use index(wherecontains()) to store filtered sets of your data into local with() variables, and pass in those data sets into your grids.

    2. The hard bit then, is when I select "remove row", how can I best manage the index so it deletes the correct row?

    It sounds like what you're going to want here is wherecontains(). This will allow you to determine the index in your main unfiltered array for the element that exists in one of your filtered arrays. Once you have this index, you may proceed to remove that element as you design. If your CDTs are backed by tables, the best practice would be to set an "isActive" flag to false for that element, rather than simply removing it from your data set.

Children
No Data