Select to view content in your preferred language

Refresh featureTable doesn't work properly

4716
2
05-18-2021 06:42 AM
YingwenDeng
Emerging Contributor

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.

YingwenDeng_0-1621344727106.png

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.) 

 

0 Kudos
2 Replies
UndralBatsukh
Esri Regular Contributor

Hello there, 

Thank you for reporting this issue and we confirmed this indeed is an issue. I will update you as soon as this issue is fixed. 

Thanks,

-Undral

HeatherGonzago
Esri Contributor

Hi, just wanted to let you know that we addressed this for our upcoming 4.20 release and you should no longer experience this issue with the table not refreshing properly. Thanks for letting us know.