I loaded an excel file and then converted it as a FeatureTable. I want to turn off some fields (or columns, e.g OBJECTID) when the table is loaded.
Set up a field list and specify how to show/handle specific columns:
var lstFields = [ { name: OBJECTID, visible: false }, { name: "StopID", label: "Stop ID: ", direction: "asc", editable: false }, { name: "Location", label: "Bus Stop Location: " }, { name: "Routes", label: "Routes Served: ", direction: "asc"}, { name: "Jurisdiction", label: "Jurisdiction: ", required: true } ]
Then, when you define the FeatureTable you can use this field list for the 'fieldConfigs' value:
busStopViewTable = new FeatureTable({ view: view, layer: busStopsLayer, editingEnabled: true, menuConfig: { items: [{ label: "Zoom to feature(s)", iconClass: "esri-icon-zoom-in-magnifying-glass", clickFunction: function (event) { //zoomToSelectedFeatureTable(); console.log("Need to build zoomToSelectedFeatureTable function"); } }] }, // Autocast the FieldColumnConfigs fieldConfigs: lstFields, container: document.getElementById("tableDiv") });
Perfect! Thanks A LOT!
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.