Attribute Inspector sample Legacy to AMD

2266
4
Jump to solution
09-04-2015 06:07 AM
TimWitt2
MVP Alum

Hey everybody,

I was trying to translate the following sample from Legacy to AMD, but I ran into some issues:

This is the sample: Multiple Attribute Inspectors | ArcGIS API for JavaScript

This is how far I have gotten: JS Bin - Collaborative JavaScript Debugging

I have the following issues:

1) Doesn't matter what template I pick I get the question mark symbol. (Thanks to Robert this is fixed)

2) When I create a new feature it does not save the attributes I put in a field. (fixed this issue in the latest version)

3) I have also noticed that in both the sample and my translation, when you first create a feature, the popup box doesn't have the header with the X to close it.

Thanks!

Tim

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tim,

  Here is that (line 4):

          selectedTemplate.featureLayer.applyEdits([newGraphic], null, null, function () {
            templatePicker.clearSelection();
            var screenPoint = map.toScreen(getInfoWindowPositionPoint(newGraphic));
            map.infoWindow.setTitle("Edit Feature");
            map.infoWindow.setContent(attInspector.domNode);
            map.infoWindow.resize(325, 185);
            map.infoWindow.show(screenPoint, map.getInfoWindowAnchor(screenPoint));
          });

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Tim,

  I still can not figure out why but here is the two line I changed to get the graphic to have the correct symbol.

          var newGraphic = new Graphic(geometry);
          newGraphic.setAttributes(newAttributes);
TimWitt2
MVP Alum

Thanks Robert, that does the trick.

So the only thing that is left is the pop-up box.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Tim,

  Here is that (line 4):

          selectedTemplate.featureLayer.applyEdits([newGraphic], null, null, function () {
            templatePicker.clearSelection();
            var screenPoint = map.toScreen(getInfoWindowPositionPoint(newGraphic));
            map.infoWindow.setTitle("Edit Feature");
            map.infoWindow.setContent(attInspector.domNode);
            map.infoWindow.resize(325, 185);
            map.infoWindow.show(screenPoint, map.getInfoWindowAnchor(screenPoint));
          });
TimWitt2
MVP Alum

Thank you Robert as always.

0 Kudos