How do I make these fields editable?

3605
2
Jump to solution
03-17-2015 02:27 PM
ChrisSergent
Regular Contributor III

The following fields display in a popup box when the user clicks on them. How do I get the editor form to appear instead?:

 infoTemplate: {
      title: '<b>Request ${objectid}</b>',
      content: '<span class="infoTemplateContentRowLabel">Date: </span>' +
          '<span class="infoTemplateContentRowItem">${requestdate:DateFormat}</span><br><span class="infoTemplateContentRowLabel">Phone: </span>' +
          '<span class="infoTemplateContentRowItem">${phone:formatPhoneNumber}</span><br><span class="infoTemplateContentRowLabel">Name: </span>' +
          '<span class="infoTemplateContentRowItem">${name}</span><br><span class="infoTemplateContentRowLabel">Severity: </span>' +
          '<span class="infoTemplateContentRowItem">${severity:severityDomainLookup}</span><br><span class="infoTemplateContentRowLabel">Type: </span>' +
          '<span class="infoTemplateContentRowItem">${requesttype:requestTypeDomainLookup}</span><br><span class="infoTemplateContentRowLabel">Comments: </span>' +
          '<span class="infoTemplateContentRowItem">${comment}</span>'
    }
  };

The form startup is I believe, the following, but I am not sure:

// initialize the request type drop down
  var initAttributeForm = function() {
    var options = [];
    for (var key in app.requestTypeFieldDomainCodedValuesDict) {
      if (app.requestTypeFieldDomainCodedValuesDict.hasOwnProperty(key)) {
        options.push('<option value="' + key + '">' + app.requestTypeFieldDomainCodedValuesDict[key] + '</option>');
      }
    }
    app.requestTypeSelect.innerHTML = options.join('');
  };

Here is the app online: csergent45/streetSigns · GitHub

Kelly Hutchins​ or Robert Scheitlin, GISP​ is it possible to use this:

layer.on("click", function(evt) {
              event
.stop(evt);
             
if (evt.ctrlKey === true || evt.metaKey === true) {  //delete feature if ctrl key is depressed
                layer
.applyEdits(null,null,[evt.graphic]);
                currentLayer
= this;
                editToolbar
.deactivate();
                editingEnabled
=false;
             
}
           
});
         
});

but instead use the startCaptureRequest function like so. but this did not work. I was hoping to pull up the form. Wait, I need an edit form too, don't I? Not just a submit form? :

layer.on("click", function(evt) {

// temporarily show alert when starting edits 

    // and then start listening for a map click 

    var startCaptureRequest = function (severity) {

        var listener;

        // NOTE: once user has clicked 'x' to dismiss 

        // this alert, it will no longer show up 

        domStyle.set(app.startEditAlert, 'display', '');

        setTimeout(function () {

            domStyle.set(app.startEditAlert, 'display', 'none');

        }, 3000);

        // save map point in app global and 

        app.currentSeverity = severity;

        listener = app.map.on('click', function (e) {

            listener.remove();

            // save map point in app global and 

            // show form to collect incident report 

            app.currentGeometry = e.mapPoint;

            app.attributesModal.modal('show');

        });

    };

}

Here is my app that I published online. I am trying to make it so I can edit the points: Street Signs

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Chris,

   It will be easier if you focus on getting the "Add street sign or support" form working for adding a new point first. Change all the form items to use your attributes etc. Then once you have done that it will be easier for us to help you pop that up when you click on a streetsign. Right now neither the popup or the add form matches your actual data.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Chris,

   It will be easier if you focus on getting the "Add street sign or support" form working for adding a new point first. Change all the form items to use your attributes etc. Then once you have done that it will be easier for us to help you pop that up when you click on a streetsign. Right now neither the popup or the add form matches your actual data.

ChrisSergent
Regular Contributor III

Good point. I think I can modify the form on my own. Once that's done I can start a new thread. Appreciate the advice.

0 Kudos