Select to view content in your preferred language

Hidden column in calcite-table

164
3
11-21-2024 05:05 AM
Dirk_Vandervoort
Frequent Contributor

Hello:

I would like to store data in a column in a calcite-table. However I would like to hide the column from the user.

Is there a way to achieve this?

This code does not work:

 

<calcite-table-header heading='My Column' hidden></calcite-table-header>

 

This works to hide the column header, but the column still shows data:

<calcite-table-header heading='My Column' style="visibility: hidden;"></calcite-table-header>

TIA 

0 Kudos
3 Replies
KittyHurley
Esri Contributor

@Dirk_Vandervoort you could consider not rendering the column in the DOM so it isn't accessible to users.

Calcite is working towards a more advanced Table component that will offer more capabilities and support targeted for late 2025.

0 Kudos
Dirk_Vandervoort
Frequent Contributor

This problem with not rendering the column in the DOM (not adding the calcite-table-header) is that when I add rows to the table, the cells that are not represented by the calcite-table-header still show data without the calcite-table-header

Dirk_Vandervoort_1-1732385966989.png

 

 

0 Kudos
KittyHurley
Esri Contributor

@Dirk_Vandervoort May be misinterpreting the goal - are you aiming to:

1. Hide all the contents of a column, such as the header and cell, and/or

2. Provide multiple cells, but contain less headers, similar to the "Table with complex col-span and row-span" sample? For instance: https://codepen.io/geospatialem/pen/bNbbvWL.

If aiming for an approach that differs from the above, can you supply a Codepen or Codesandbox for more information on the use case?

0 Kudos