Hello there!
I am trying to update the feature table content when another feature layer is selected.
I have created a feature table in the beginning:
const featureTable = new FeatureTable({
view: view,
layer: featureLayer,
container: document.getElementById("tableDiv")
});Then I want to update the table content with something like this:
switch(selectedLayer){
case "layer01":
layer01.visible = true;
layer02.visible = false;
layer03.visible=false;
featureTable.layer = layer01;
featureTable.refresh();
break;
case "layer02":
layer02.visible = true;
layer03.visible = false;
layer04.visible = false;
featureTable.layer = layer02;
featureTable.refresh();
break;
case "layer03":
layer03.visible = true;
layer01.visible=false;
layer02.visible = false;
featureTable.layer = layer03;
featureTable.refresh();
break;
}But as a result, when I select Layer02, only the table title updates. The content is somehow not showing.

Anyone could please help me? Thanks!
(My temporary solution is to add three feature tables in the app and use "display = 'none' to hide the ones that are not selected..." but I guess there must be better solutions.)