Update Feature Attributes
Note: Support for 3D on mobile devices may vary, view the system requirements for more information.
This sample demonstrates how to use FeatureLayer.applyEdits() to update attributes of existing features. This sample uses the FeatureForm widget to update attributes of existing features by calling the applyEdits
function when a user selects a feature on the view.
The form is set up to display grouped field configurations. Having grouped field configurations provides a more manageable editing workflow. This sample uses nested field configurations which autocasts to FieldGroupConfig.
form = new FeatureForm({
container: "form",
groupDisplay: "sequential",
layer: featureLayer,
fieldConfig: [{
label: "Inspector information",
description: "Field inspector information"
fieldConfig: [{
name: "inspector",
label: "Name"
},
{
name: "inspemail",
label: "Email address"
},
{
name: "inspdate",
label: "Date of inspection"
}]
},
{
label: "Contact information",
description: "The insured's contact information",
fieldConfig: [{
name: "placename",
label: "Business name"
},
{
name: "firstname",
label: "First name"
},
{
name: "lastname",
label: "Last name"
},
{
name: "workphone",
label: "Work telephone number"
}]
},
{
label: "Insurance coverage"
description: "Structure and contents coverage",
fieldConfig: [{
name: "strinsur",
label: "Structure insured"
},
{
name: "continsur",
label: "Contents insured"
}]
},
{
label: "Insurance type information",description: "Type of insurance coverage",
fieldConfig: [{
name: "rentinsur",
label: "Renter's"
},
{
name: "floodinsur",
label: "Flood"
},
{
name: "fireinsur",
label: "Fire"
}]
}
]
});