I'm also try to create voting in Edit widget. Do you get the solution on it?
I try to calculate vote in editor widget, but the fiedvalue is not firing, no value are show in my text box.
var layerInfos = [
{
'featureLayer': layertemplate,
'showAttachments': true,
'isEditable': true,
'showDeleteButton': true,
'fieldInfos': [
{ 'fieldName': 'NAMA_PELAPOR', 'isEditable': false, 'label': PL + ':' },
{ 'fieldName': 'ADDRESS', 'isEditable': false, 'label': AD + ':' },
{ 'fieldName': 'POI_NAME', 'isEditable': false, 'label': TT + ':' },
{ 'fieldName': 'NO_TEL_PELAPOR', 'isEditable': false, 'label': TL + ':' },
{ 'fieldName': 'CATATAN', 'isEditable': true, 'label': CT + ':' },
{ 'fieldName': stat, 'isEditable': true, 'label': ST + ':' },
{ 'fieldName': 'PUBLIC_VIEW', 'isEditable': true, 'label': PV + ':' },
{ 'fieldName': 'ARAS_KEDALAMAN', 'isEditable': true, 'label': AK + ':' },
{ 'fieldName': 'TYPE', 'isEditable': true, 'label': TY + ':' },
{ 'fieldName': 'PENGEMASKINI', 'isEditable': false, 'label': UP + ':' },
{ 'fieldName': 'LONGITUDE', 'isEditable': true, 'label': 'LONGITUDE' + ':' },
{ 'fieldName': 'LATITUDE', 'isEditable': true, 'label': 'LATITUDE' + ':' }
]
}
];
var attInspector = new AttributeInspector({
layerInfos: layerInfos
}, domConstruct.create("div")); //"attributeDiv");
console.log({ attInspector });
selectQuery.objectIds = [evt.graphic.attributes.OBJECTID];
layertemplate.selectFeatures(selectQuery, FeatureLayer.SELECTION_NEW, function (features) {
if (features.length > 0) {
//store the current feature
updateFeature = features[0];
console.log(attInspector.domNode);
count_like = (updateFeature.attributes["COUNT_RATING"]) ? updateFeature.attributes["STAR_RATING"] : 0;
start_rating = (updateFeature.attributes["STAR_RATING"]) ? updateFeature.attributes["STAR_RATING"] : 0;
if (id == "33") {
content = "<br/><i><span id='numPeople'>" + count_like +
"</span> <img style='cursor:pointer;height:20px;width:20px' src='../assets/img/thumbup.png'> Like this restaurant.</i><br/><hr/>";
content += attInspector.domNode.innerHTML;
content += "<br/><hr/>Average rating :" + start_rating;
console.log({ content });
map.infoWindow.setTitle(features[0].getLayer().name);
map.infoWindow.setContent(content);
map.infoWindow.resize(350, 200);
map.infoWindow.resize(350, 180);
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
}