ESRI JS API 4.11: error in documentation of FeatureTemplates widget

530
3
04-03-2019 02:26 AM
NicolasGIS
Occasional Contributor III

Hello,

I migrated from 4.10 to 4.11 an application using FeatureTemplates widget  and noticed that the filterFunction callback parameter is not the one stated in the documentation anymore:

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureT...

In 4.11, "filterFunction takes a function which passes in an object containing a label property  of the FeatureLayer and a templates property containing the templates of this layer".

CodePen

Thanks,

Nicolas

Tags (1)
0 Kudos
3 Replies
HeatherGonzago
Esri Contributor

Hi Nicolas,

Thanks for catching that. We updated `name` to `label` in this latest release but failed to update the code snippet.

You just need to update it to read,

function myFilterFunction(filter) {
  let containsName = filter.label.includes("animal");
  return containsName;
}

If you are interested in how this would work, check out the Editor widget with configurations sample. This uses a custom grouping function.  We'll fix this for our next SDK documentation update.

0 Kudos
KenBuja
MVP Esteemed Contributor

Hi Heather Gonzago,

You're pointing to your own server (heatherg-2.esri.com) in your link.

0 Kudos
HeatherGonzago
Esri Contributor

Whoops, one of those days and one too many open tabs in my browser. Thanks, I've updated it to point to the Developers site.

0 Kudos