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.
Solved! Go to Solution.
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")
});
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!