Editor's AttributeInspector and additional buttons

1289
1
05-13-2011 07:24 AM
KirillLykov
New Contributor
In order to edit featureLayer I use Editor. When I add a new feaure to the layer, I want to do some additional action on it(eg send it somewhere). So I added Save button to the AttributeInspector (editor._attributeInspector) like in the esri's example
            //Create the editor widget 
     var editorWidget = new esri.dijit.editing.Editor(params);
     
     //resize the info window (attribute inspector)
     this._mapwrapper._currentmap.infoWindow.resize(260,215);
  
     var attInspector = editorWidget._attributeInspector;
  var saveButton = new dijit.form.Button({label:"Save","class":"saveButton"});
        dojo.place(saveButton.domNode, attInspector.deleteBtn.domNode, "before");

        dojo.connect(saveButton, "onClick", function(event){
   //Here, I need to have date user entered
                    
        });
  
  editorWidget.startup();


The problem is I don't know how to get data user has entered in the AttributeInspector's textBoxes (attributes values). Do you know how I can get them?
0 Kudos
1 Reply
HemingZhu
Occasional Contributor III
In order to edit featureLayer I use Editor. When I add a new feaure to the layer, I want to do some additional action on it(eg send it somewhere). So I added Save button to the AttributeInspector (editor._attributeInspector) like in the esri's example
            //Create the editor widget 
     var editorWidget = new esri.dijit.editing.Editor(params);
     
     //resize the info window (attribute inspector)
     this._mapwrapper._currentmap.infoWindow.resize(260,215);
  
     var attInspector = editorWidget._attributeInspector;
  var saveButton = new dijit.form.Button({label:"Save","class":"saveButton"});
        dojo.place(saveButton.domNode, attInspector.deleteBtn.domNode, "before");

        dojo.connect(saveButton, "onClick", function(event){
   //Here, I need to have date user entered
                    
        });
  
  editorWidget.startup();


The problem is I don't know how to get data user has entered in the AttributeInspector's textBoxes (attributes values). Do you know how I can get them?


The AttributeInspector have an event call onAttributeChange(). It fires when a field value change. U can use variables to hold the info (feature, fieldName, fieldValue). And then use it in your onClick handler...
0 Kudos