Getting hold of a feature layer's display field with version 4 of the JavaScript API

1622
1
Jump to solution
07-29-2016 06:48 AM
MattJones
New Contributor III


Hi,

I want to get hold of a feature layer's display field. This property doesn't seem to be present on a feature layer. Is there a way to get hold of it with version 4 of the API?


Thanks,


Matt

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Matt,

  The way I have found is this:

featureLayer.on("layerview-create", function(){
  console.info(featureLayer.source.layerDefinition.displayField);
});

View solution in original post

1 Reply
RobertScheitlin__GISP
MVP Emeritus

Matt,

  The way I have found is this:

featureLayer.on("layerview-create", function(){
  console.info(featureLayer.source.layerDefinition.displayField);
});