FeatureTable dijit doesn't honor outFields?

3594
2
04-09-2015 03:46 PM
ChrisBennett1
New Contributor

The new FeatureTable dijit seems to have no way to programmatically set the visible columns.  I know I can use the menu to hide/show fields, but it's impractical to have to uncheck a bunch of fields every time the page is loaded. Meanwhile, the doc page's Properties section says: "Attribute fields to include in the FeatureTable."

For example, if you try adding the "outFields" parameter to the FeatureTable in the sandbox (ArcGIS API for JavaScript Sandbox), it has no effect. In fact, there seems to be no programmatic way to limit the fields displayed in the table. In version 3.12, the FeatureTable at least honors the "outFields" of the target FeatureLayer, but version 3.13 always takes the entire set of fields from the map service.

Workarounds?

Any ideas as to when it might be fixed?

Thanks!

-Chris.

Tags (1)
0 Kudos
2 Replies
StevenGraf1
Occasional Contributor III

Hey Chris, I just came across your question while doing a little research myself.  I was able to change the hiddenFields parameter to outFields and it honored the fields that were listed.

myTable = new FeatureTable({
            "featureLayer" : myFeatureLayer,
            //"dateOptions": {
            //  "timeEnabled" : true,
            //  "timePattern" : "HH:mm:ss",
            //  "datePattern" : "YYYY-MM-DD"
            //},
            "outFields": ["FID","C_Seq","Street"],  // field that end-user can show, but is hidden on startup
            "map" : map
          }, 'myTableNode');

I even had hiddenFields: [], in the contructor and it honored those as well.

myTable = new FeatureTable({
            "featureLayer" : myFeatureLayer,
            //"dateOptions": {
            //  "timeEnabled" : true,
            //  "timePattern" : "HH:mm:ss",
            //  "datePattern" : "YYYY-MM-DD"
            //},
            "hiddenFields": ["FID"],
            "outFields": ["FID","C_Seq","Street"],  // field that end-user can show, but is hidden on startup
            "map" : map
          }, 'myTableNode');

Are you still seeing this issue?

Steven

ChrisBennett1
New Contributor

Hi Steven, thanks for the reply! It does look like the behavior has changed. Actually, though, my problem was a little more complicated (some null data affecting the display of others) and I had to move on to something else. I expect to restart the project sometime soon and will update when I get more info.

-Chris.

0 Kudos