I have a shapefile hosted as Feature Layer at ESRI Server.
I create a Leaflet application where I want to enable an attributes update of my Feature Layer (field 'Status'). I have customized a popup where users can choose an attribute value from the list. This value has to be sent to the server as soon as they click the "OK" button.
I tried to make use of Ajax. Console log returns an updated attribute, however I can not see any changes when I look at the data at ESRI Server.
Probably UpdateFeature function works only with geometry.
var net = L.esri.featureLayer({ url: netURL}).addTo(map);
var status_content = '<form role="form" id="form" enctype="multipart/form-data" onsubmit="addMarker()">'+
'<p style="font-size:12px;"><b>Update status</b></p>'+
'<div>'+
'<select class="form-control" id="st" name="new_status">'+
'<option value="etab">Established</option>'+
'<option value="plan">Planned</option>'+
'<option value="default">Default</option>'+
'</select>'+
'</div>'+
'<div align="right" >'+
'<button type="button" title="Save new status" class="ok" id="OK"><img src="ok.png"></button>'+
'</div>';
net.on('click', function(e) {
net.bindPopup(status_content);
e.layer.openPopup();
$(document).ready(function(){
$("#OK").click(function(){
e.layer.feature.properties["Status"] = $("#st").val();
net.updateFeature(e.layer.feature.properties.Status);
console.log (e.layer.feature.properties.Status);
e.layer.closePopup();
});
});
});