private function featureLayer_selectionComplete(event:FeatureLayerEvent):void { for each (var field:Field in event.target.layerDetails.fields) { // added by fr next 5 lines if (field.name == "Event_Name"){ trace ("I found the called Event_Name!!!"); // I want to do something like below, but this doen't work: for each (var feature:Graphic in event.features) { feature.attributes[field.name] = "this is a test"; } } if (field.type == Field.TYPE_DATE) { for each (var feature:Graphic in event.features) { var date:Date = new Date(feature.attributes[field.name]); if (date.milliseconds == 999) { date.milliseconds++; //Add 1ms to date values ending in 999 to workaround REST date bug feature.attributes[field.name] = date.time; } } } } }
private function featureLayer_selectionComplete(event:FeatureLayerEvent):void { for each (var field:Field in event.target.layerDetails.fields) { // added by fr next 5 lines if (field.name == "Event_Name"){ trace ("I found the called Event_Name!!!"); // I want to do something like below, but this doen't work: //feature.attributes[field.name] = "this is a test"; } if (field.type == Field.TYPE_DATE) { for each (var feature:Graphic in event.features) { var date:Date = new Date(feature.attributes[field.name]); if (date.milliseconds == 999) { date.milliseconds++; //Add 1ms to date values ending in 999 to workaround REST date bug feature.attributes[field.name] = date.time; } } } } }
private function featureLayer_selectionComplete(event:FeatureLayerEvent):void { for each (var field:Field in event.target.layerDetails.fields) { if (field.type == Field.TYPE_DATE) { for each (var feature:Graphic in event.features) { //var date:Date = new Date(feature.attributes[field.name]); var date:Date = new Date(); if (date.milliseconds == 999) { date.milliseconds++; //Add 1ms to date values ending in 999 to workaround REST //date bug } feature.attributes[field.name] = date.time; } } } }
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.