** Doesn't always update selected tab when you select a new entity
** Doesn't update selected tab when you change the relations on an entity
-** Direct click-to-edit of relation role should actually work
-** Double-clicking a relation to edit it comes up with the POIs!
+* Double-clicking a relation to edit it sometimes comes up with the POIs (how to reproduce?)
* Dynamic reloading of stylesheet/map_features, so that you don't need to reload the full page when editing them
* If a select name is too long then, the select menu seems to give a horizontal scrollbar instead of the name of the item e.g. cuisine#Coffee Shop
* If you have both inputSets names and buildingAddress, and name= key is filled in then the basic tab will get both, surely only name should be shown and building name should be ignored e.g. cafes. [Actually this was an issue of addr: being missing from one of them, however this may still be a problem for other overlapping inputSets]
rel.removeEventListener(Connection.RELATION_MEMBER_REMOVED, entityRelationMemberChanged);
}
listeningToRelations = [];
+ relationsGrid.removeEventListener(DataGridEvent.ITEM_EDIT_END, relationRoleChanged);
}
private function resetRelationsGrid(entity:Entity):void {
listeningToRelations.push(rel);
}
relationsGrid.dataProvider = relations;
+ relationsGrid.addEventListener(DataGridEvent.ITEM_EDIT_END, relationRoleChanged, false, -100);
}
+ private function relationRoleChanged(event:DataGridEvent):void {
+ if (event.dataField != 'role') { return; } // shouldn't really happen
+
+ var relations:Array=event.currentTarget.dataProvider.toArray();
+ var props:Object=relations[event.rowIndex];
+
+ var relation:Relation=props['relation'];
+ var index:uint=props['index'];
+ var newRole:String=event.itemRenderer.data['role'];
+
+ relation.setMember(index, new RelationMember(selectedEntity,newRole));
+ }
+
private function relationTagChanged(event:TagEvent):void {
resetRelationsGrid(selectedEntity);
}