Editor-All Build up

3659
10
07-20-2015 09:49 AM
MichaelStranovsky
Occasional Contributor

Using the selection tool on the toolbar of the editor widget to select multiple points.  When I click the attribute tool on the toolbar, I only get one feature in the AttributeInspector infowindow.   I do not get the navigation buttons on the AttributeInspector. 

mapMain.on("layers-add-result", initEditing);

function initEditing (evt) {

  layers = arrayUtils.map(evt.layers, function(result) {

        return {featureLayer: result.layer};

        });

         

  createEditor();

}

function createEditor() {

        if (myEditor) {

         return;

        }

        var settings = {

        map: mapMain,

        enableUndoRedo: true,

            geometryService: new GeometryService("https://ags2.scgov.net/arcgis/rest/services/Utilities/Geometry/GeometryServer"),

            layerInfos: layers,

            toolbarVisible: true,

            toolbarOptions: {

              reshapeVisible: false

            }

  };

        var params = {settings: settings};

        

        myEditor = new esri.dijit.editing.Editor(params,domConstruct.create("div"));

        domConstruct.place(myEditor.domNode, "editorDiv");

         

        myEditor.startup();

}

0 Kudos
10 Replies
thejuskambi
Occasional Contributor III

Can you share the code where selection is happening?

0 Kudos
DavidColey
Frequent Contributor

Michael, Thejus - I am experiencing the same problem.  If you go to the jsapi sample at:

Editor widget with simple toolbar | ArcGIS API for JavaScript

and perform a selection on more than one feature using the edit toolbar selection tool>open attribute inspector, only the first-selected features' attributes are populated in the attribute inspector with no paging controls.

Does the attribute inspector need to be instancicated seperatly from the editor widget so that paging controls will display?  If so, do we have to calll in attribute inspector events to move to a next feature?

Any help is appreciated-

David

0 Kudos
MichaelStranovsky
Occasional Contributor

I am not explicitly applying a selection through the code.   I am using the sample from Editor Widget with Simple Toolbar.   The selection is occurring on the widget toolbar's selection tool.   If you run the sample on ESRI Javascript API, you will see that theirs is not working also.  So if you use the select tool from the editor widget toolbar to select multple features and the click the attribute tool, you only get the first selected feature.

0 Kudos
thejuskambi
Occasional Contributor III

I dont know why, but for some strange reason the Editor does not show the next previous button if the map.infoWindow is set to default i.e. Popup. If you change it to use InforWindow or InfoWindowLite, it starts showing the button.

        var infoWindow = new InfoWindow({}, domConstruct.create("div"));
        infoWindow.startup();
       
        map = new Map("map", {
          basemap: "satellite",
          center: [-96.541, 38.351],
          zoom: 14,
          slider: false,
          infoWindow: infoWindow
        });

If the way infowindow show is not a problem than the above code will work.

DavidColey
Frequent Contributor

Way to go thejsu, that's it - thanks!

David

0 Kudos
MichaelStranovsky
Occasional Contributor

Thank you for the reply...this did work but we discovered that it rendered the search widget useless.   We will have to dig a little deeper to find out why the seach stop working after adding your code above.

0 Kudos
thejuskambi
Occasional Contributor III

Is it possible to create a jsFiddler or somthing. so that I can take a look at it.

Does anybody know if there is a bug reported for this issue(next & previous missing)?

0 Kudos
DavidColey
Frequent Contributor

Hi Thejus - @michael Stranovsky and I work together - hence my reply to you... yes I want to get our project up in a fiddle and will let you know when - thanks.  One thing we did try and thus far has produced mixed results it adding a click event to our edit layer that calls a tolerance function to set up an extent, like what I did here

function pointToExtent (mapMain, point, toleranceInPixel) {     
    var pixelWidth = mapMain.extent.getWidth() / mapMain.width;   
    var toleranceInMapCoords = toleranceInPixel * pixelWidth;   
        return new Extent(point.x - toleranceInMapCoords,   
                              point.y - toleranceInMapCoords,   
                              point.x + toleranceInMapCoords,   
                              point.y + toleranceInMapCoords,   
                              mapMain.spatialReference);   
          }
   lyrAddresses.on('click', function (event) { //mapMain  
  console.log("im here");
         var query = new Query();   
         query.geometry = pointToExtent(mapMain, event.mapPoint, 10);   
         var deferred = lyrAddresses.selectFeatures(query, //featurelayer  
              FeatureLayer.SELECTION_NEW);   
            //mapMain.infoWindow.setFeatures([deferred]);   
            //mapMain.infoWindow.show(event.mapPoint);   
          }); 

The thinking being that an extent has to be accessed in order for the popup to know that there is more than one feature -- but  I don't know.  As soon as I interact with the search dijit and try to go back to the edit tools no paging occurs-

David

0 Kudos
thejuskambi
Occasional Contributor III

Hi David,

I shall try to explain my finding, I dont understand their reason for doing this way. If someone from ESRI can explain this then great. Here I go.

The ability to hide or show pagination in Editor's AttributeInspector is controlled by hideNavButtons parameter which can be passed only through constructor. Bydefault this value is linked to Editor._usePopup property. which again is set if map.infoWindow has "_setPagerCallbacks" method implemented or not. This method is only part of Popup class.  Hence, I suggested to use something other then Popup which is default for map.infoWindow.

Regarding, Search failing, there seems to be some relationship between map.infoWindow and Search dijit. probably you could set enableInfoWindow to false, if you dont need this. you need to figure it out.

Another way is to create your own AttributeInspector and pass it to Editor as settings.attributeInspector, and you can control what to show or hide. Again this has not been documented clearly.

Hope I was helpful.

Thejus