var feat = { "attributes": { "OBJECTID": 1094, "Well_ID": 565656, "GWIC_ID": "efg789", "Geomethod_ID": 5, "Township": "1N", "Range": "1E", "Section_": "1", "Quarter_Section": "sw ne", "Physical_Address_WellName": "Baxter and Puckett", "Subdivision": "Test point 07", "City_ID": 4, "TotalDepth_ft_": "87" } }; Feat_Layer01.applyEdits(null,[feat],null,function(res){ console.log('worked: '+dojo.toJson(res)); /* if (res.length > 0){ if (res[0].success){ Ext.MessageBox.alert('MESSAGE', 'Updated well objectid: '+updres[0].objectId); } else { Ext.MessageBox.alert('MESSAGE', 'Well update unsuccessful'); } } else { Ext.MessageBox.alert('MESSAGE', 'Well objectid not found'); } */ },function(er){ console.log('errored: '+dojo.toJson(er)); //Ext.MessageBox.alert('ERROR', 'Update Error:<br />'); }); { "addResults": [], "updateResults": [ { "objectId": 1094, "success": true } ], "deleteResults": [] }Solved! Go to Solution.
layer.applyEdits([feature], null, null, function (add, update, del) {
array.forEach(add, function (a) {
console.log(a.status);
});
}, function (error) {
console.log(error);
});
layer.applyEdits(null, [feature], null, function (add, update, del) {
array.forEach(update, function (u) {
console.log(u.status);
});
}, function (error) {
console.log(error);
});
layer.applyEdits(null, null, [feature], function (add, update, del) {
array.forEach(del, function (d) {
console.log(d.status);
});
}, function (error) {
console.log(error);
});
Feat_Layer01.applyEdits(null,[feat],null,function(add, upd, del){
if (upd.length > 0){
if (upd[0].success){
Ext.MessageBox.alert('MESSAGE', 'Updated well objectid: '+upd[0].objectId);
}
else {
Ext.MessageBox.alert('MESSAGE', 'Well update unsuccessful');
}
}
else {
Ext.MessageBox.alert('MESSAGE', 'Well objectid not found');
}
},function(er){
Ext.MessageBox.alert('ERROR', 'Update Error:<br />'+er.message);
});
{
"addResults": [],
"updateResults": [
{
"objectId": 1094,
"success": true
}
],
"deleteResults": []
}
var feature = new Graphic();
feature.setAttributes({
OBJECTID: 1094,
Well_ID: 565656,
GWIC_ID: "efg789",
Geomethod_ID: 5,
Township: "1N",
Range: "1E",
Section_: "1",
Quarter_Section: "sw ne",
Physical_Address_WellName: "Baxter and Puckett",
Subdivision: "Test point 07",
City_ID: 4,
TotalDepth_ft_: "87"
});
Apply Edits Error:
_196.geometry is undefined
{
"addResults": [],
"updateResults": [
{
"objectId": 2294,
"success": true
}
],
"deleteResults": []
}
this.inspector.on('attribute-change', lang.hitch(this, function (result) {
var feature = result.feature;
var atts = feature.attributes;
for (var i in atts) {
if (i === result.fieldName) {
atts = result.fieldValue;
}
}
this.applyEdits(null, [feature], null, function (a, u, d) {
console.log(u[0]);
}, function (error) {
console.log(error);
});
}));