FieldGroupConfig
require(["esri/widgets/FeatureForm/FieldGroupConfig"], function(FieldGroupConfig) { /* code goes here */ });
esri/widgets/FeatureForm/FieldGroupConfig
Configuration options for displaying a group of fields within the FeatureForm widget. The widget automatically detects if field grouping should apply based on how the widget's fieldConfig property is configured.
- See also:
const featureForm = new FeatureForm({
container: "formDiv",
fieldConfig: [{
label: "First group",
description: "This is the first group in the FeatureForm",
fieldConfig: [{
name: "StreetName",
label: "Street Name",
description: "Updated street name"
},
{
name: "AOI",
label: "Area of Interest",
description: "Fun places to visit"
},
]},
{
label: "Second group",
description: "This is the second group for the FeatureForm",
fieldConfig: [{
name: "telephone",
label: "Contact number",
description: "Get in touch by phone"
},
{
name: "emailaddress",
label: "Email address",
description: "Get in touch through email"
}]
]}
});
Constructors
- new FieldGroupConfig(properties)
- Parameter:properties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | The name of the class. more details | more details | Accessor | |
String | The field's description. more details | more details | FieldGroupConfig | |
FieldConfig[] | The field configurations belonging to a group. more details | more details | FieldGroupConfig | |
String | The field's label. more details | more details | FieldGroupConfig |
Property Details
The name of the class. The declared class name is formatted as
esri.folder.className
.
- descriptionString
The field's description. The description is shown below the field.
- fieldConfigautocast
The field configurations belonging to a group. For an example of grouped field configurations, please refer to the Update Feature Attributes sample.
Examples:// Individual field configurations without grouping const featureForm = new FeatureForm({ container: "formDiv", feature: graphic, // Pass in feature // Configure fields to display without grouping fieldConfig: [ // autocasts as FieldConfig { name: "Incident_desc", label: "Description" },{ name: "Incident_Address", label: "Contact" }] });
// Grouped field configurations const featureForm = new FeatureForm({ container: "formDiv", feature: graphic, fieldConfig: [{ // autocasts to FieldGroupConfig label: "Inspector", // group 1 description: "Inspector information", // Individual field configurations within the group fieldConfig: [{ name: "inspector", label: "Name" }, { name: "inspemail", label: "Email address" }] }, { label: "Business", // group 2 description: "Business information", // Individual field configurations within the group fieldConfig: [{ name: "placename", label: "Business name" }, { name: "firstname", label: "First name" }] }] });
- labelString
The field's label. The label is shown above the field.