Hello, I would like to ask if the sample provided for the WAB Attribute Table is correct? We attempted to try and paste in the sample code into a "config_AttributeTable.json" file that we created and then linked to in the WAB's main "config.json" file.
Unfortunately the sample did not appear to work and so we began to look closer at the Attribute Table Sample below:
Attribute Table—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers
As a result we noticed a number of errors with the initiallyExpand attribute lacking double quotation marks ("initiallyExpand") and apparently some issues with the curly brackets not being closed properly as well (the last bracket is not paired with another bracket).
Could you provide an updated example of how we need to structure the config file for the Attribute Table Widget?
Thank you for your time,
Marut T.
Solved! Go to Solution.
Marut,
Sorry for the error sample.
Please try this sample:
{ "layerInfos": [{ "name": "Wildfire - Wildfire Response Polygons", "id": "Wildfire_556", "layer": { "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2", "fields": [{ "show": false, "name": "objectid", "alias": "objectid" }, { "show": true, "name": "symbolid", "alias": "symbolid" }, { "show": true, "name": "description", "alias": "description" }, { "show": false, "name": "created_user", "alias": "created_user" }, { "show": false, "name": "created_date", "alias": "created_date" }, { "show": false, "name": "last_edited_user", "alias": "last_edited_user" }, { "show": false, "name": "last_edited_date", "alias": "last_edited_date" }] }, "show": true }, { "name": "ArcGIS feature layer", "id": "Wildfire_3119", "layer": { "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2" }, "show": true } ], "initiallyExpand": false }
ps: The layers in config.json must in your webmap, if not it will not get records in AttributeTable.
I can't answer answer about whether the initiallyExpand:false needs quotes or not or whether it works or not, but I did check the balance of the brackets and is does look line line 46 has an extra } from what I can see (the ] should be there I think).
Anyway, just confirming that they don't balance in the code sample.
Marut,
Sorry for the error sample.
Please try this sample:
{ "layerInfos": [{ "name": "Wildfire - Wildfire Response Polygons", "id": "Wildfire_556", "layer": { "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2", "fields": [{ "show": false, "name": "objectid", "alias": "objectid" }, { "show": true, "name": "symbolid", "alias": "symbolid" }, { "show": true, "name": "description", "alias": "description" }, { "show": false, "name": "created_user", "alias": "created_user" }, { "show": false, "name": "created_date", "alias": "created_date" }, { "show": false, "name": "last_edited_user", "alias": "last_edited_user" }, { "show": false, "name": "last_edited_date", "alias": "last_edited_date" }] }, "show": true }, { "name": "ArcGIS feature layer", "id": "Wildfire_3119", "layer": { "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2" }, "show": true } ], "initiallyExpand": false }
ps: The layers in config.json must in your webmap, if not it will not get records in AttributeTable.