Refresh Feature table based on visible layer?

2221
3
05-23-2016 01:44 PM
NMWater
New Contributor III

Hi ,

I have six layers, they all have the same Field names, and I want to connect them based on the feature layer that is currently visible. Do I need to add a destroy() or refresh() every time I change a layer?

Thanks!

var layer = function changetable() {

     if (CNTYmm.visible)

               {var layer = CNTYmm}

     else if (HUC8mm.visible)

               {var layer = HUC8mm}}

myFeatureTable = new FeatureTable({

  "featureLayer" : layer,

  "outFields":  ["NAME", "Units"],

  "map" : map,

  "gridOptions" : {

  allowSelectAll: true,

  allowTextSelection: true,

  },

   }, 'PrecipTable');

0 Kudos
3 Replies
JeffJacobson
Occasional Contributor III

Do I need to add a destroy() or refresh() every time I change a layer?

Yes, that is exactly what you need to do. I have heard that this will no longer be necessary at v. 3.17 of the API, though.

0 Kudos
NMWater
New Contributor III

Hi Jeff!

Thanks for your response! I still haven't had much luck with this but I believe it is a syntax issue. Just to clarify, I can do this with one Feature Table and not six? Also, any idea on when 3.17 is coming out?

Many Thanks!

0 Kudos
ChristopherJohnson1
Occasional Contributor II

Any further update on this?

Thanks...Chris

0 Kudos