Select to view content in your preferred language

FeatureTable - FeatureLayer.setDefinitionExpression

1893
3
03-02-2016 06:49 AM
ИванМехедов
Emerging Contributor

Hey! When using FeatureTable, it does not updates its content after applying setDefinitionExtension to FeatureLayer referenced FeatureTable. Are you going to fix this bug in the next release?

0 Kudos
3 Replies
TracySchloss
Honored Contributor

Has this been addressed in subsequent releases?  Some of the threads and the documentation for FeatureTable suggest we need to use a query on the underlying grid to filter the data.  It makes more sense to me to set a definitionExpression on the underlying FeatureLayer.  The variable filterValue is chosen from a filteringSelect.

     updateTable: function (filterValue) {

          app.testTable.setDefinitionExpression(("Dist_Code = '" + filterValue + "'");

}

In this example, app.testTable is defined as

app.testTable = new FeatureLayer (pathName+"/arcgis/rest/services/DHSS/EPHT_radonSchool/MapServer/2", {

  id: "testTable",

  outFields: ["*"]

  });

I'm not sure if I need to also set the table to filterSelectedRecords(true).  I'm not getting any errors displayed, but I'm not seeing the results I expected either.  In my example, this featureLayer is just a table; it doesn't contain any graphic component to tie back to my map display. 

0 Kudos
JeffJacobson
Frequent Contributor

I actually requested this enhancement a while ago. It's status is currently In Product Plan, but I don't know when they actually plan to implement this. For now you will have to work around the issue by destroying and recreating your feature table. (There are other threads on GeoNet that have example code demonstrating how to do this.)

#ENH-000094524   [Enhancement] Update Featuretable when the underlying Featurelayer's definition query changes

Open

Status: In Product Plan

Severity: Medium

Submitted: 2/28/2016

Product: ArcGIS API for JavaScript

Version: 3.16

TracySchloss
Honored Contributor

Thanks for the update.  I keep trying to use FeatureTable and end up going back to using a plain dGrid.  I thought I might be able to manipulate the grid that the FeatureTable is based on, but it doesn't take long to be more trouble than it's worth.  Maybe in some future release. 

0 Kudos