<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Editor WebComponent access viewModel.featureTemplatesViewModel.filterFunction in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-webcomponent-access-viewmodel/m-p/1697415#M88375</link>
    <description>&lt;P&gt;Using the old way of the Editor Widget wir used a filter function to exclude specific layers from the "front-page" of the EditorWidget while keeping the ability to still edit features of these layers.&lt;/P&gt;&lt;P&gt;This is how we successfully did that:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    [...]
    this._activeEditor = new Editor({
        view: mapView,
        container: this.canvasId,
        layerInfos
    });

    this._activeEditor.when(() =&amp;gt; {
        this.setFeatureTemplatesFilterAsync();
    });
}

private async setFeatureTemplatesFilterAsync() {
    const excludedTitles = await this._schema.getLayerNamesFromKeysAsync([LshLayerKeysEnum.CavePolygons, LshLayerKeysEnum.RoutingPositions]) ?? [];

    this._activeEditor!.viewModel.featureTemplatesViewModel.filterFunction = (item) =&amp;gt; {
        return !excludedTitles.some(title =&amp;gt; item?.label?.startsWith(title));
    };
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Now after changing to new web component I am asking myseld how to set the filterFunction or how to access the viewModel.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This is how it currently looks without setting the filterFunction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;arcgis-editor
    reference-element="my-map"
    [layerInfos]="layerInfos()"&amp;gt;
&amp;lt;/arcgis-editor&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2026 11:58:55 GMT</pubDate>
    <dc:creator>SebastianKrings</dc:creator>
    <dc:date>2026-04-21T11:58:55Z</dc:date>
    <item>
      <title>Editor WebComponent access viewModel.featureTemplatesViewModel.filterFunction</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-webcomponent-access-viewmodel/m-p/1697415#M88375</link>
      <description>&lt;P&gt;Using the old way of the Editor Widget wir used a filter function to exclude specific layers from the "front-page" of the EditorWidget while keeping the ability to still edit features of these layers.&lt;/P&gt;&lt;P&gt;This is how we successfully did that:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    [...]
    this._activeEditor = new Editor({
        view: mapView,
        container: this.canvasId,
        layerInfos
    });

    this._activeEditor.when(() =&amp;gt; {
        this.setFeatureTemplatesFilterAsync();
    });
}

private async setFeatureTemplatesFilterAsync() {
    const excludedTitles = await this._schema.getLayerNamesFromKeysAsync([LshLayerKeysEnum.CavePolygons, LshLayerKeysEnum.RoutingPositions]) ?? [];

    this._activeEditor!.viewModel.featureTemplatesViewModel.filterFunction = (item) =&amp;gt; {
        return !excludedTitles.some(title =&amp;gt; item?.label?.startsWith(title));
    };
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Now after changing to new web component I am asking myseld how to set the filterFunction or how to access the viewModel.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This is how it currently looks without setting the filterFunction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;arcgis-editor
    reference-element="my-map"
    [layerInfos]="layerInfos()"&amp;gt;
&amp;lt;/arcgis-editor&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 11:58:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-webcomponent-access-viewmodel/m-p/1697415#M88375</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2026-04-21T11:58:55Z</dc:date>
    </item>
  </channel>
</rss>

