Make a Attribute value Read-only in Editor Widget's InfoWindow

928
3
11-16-2010 11:47 AM
JasonMielke
New Contributor II
Hey, Does anyone know how to go about making some of the attribute values read-only in the InfoWindow that is displayed when using the Editor Widget?  I'm guessing this is similar to setting the disable property on an input textbox, but I'm not sure how to access these values in the widget generated html.  Thanks! Jason
0 Kudos
3 Replies
JasonMielke
New Contributor II
function init() {
  ...
  var editorWindow = dijit.byId("map_infowindow");
  dojo.connect(editorWindow, "onShow", onShowEditorWindow);
  ...
}

function onShowEditorWindow() {
  dijit.byId("FIELD1").disabled = true;
  dijit.byId("FIELD4").disabled = true;
}
//



jason
0 Kudos
Kathleen_Crombez
Occasional Contributor III
in your layerInfos set 'isEditable': false
0 Kudos
HemingZhu
Occasional Contributor III
in your layerInfos set 'isEditable': false


To be more specific, if you want certain attribute read-only, set the layerInfos isEditable to true, and set fieldName isEditable to false.
var layerInfos = [{
                    'featureLayer': selectedTemplate.featureLayer,
                    'isEditable': true,
                    'fieldInfos': [
                       { 'fieldName': 'STN_NAME', 'isEditable': false,  'tooltip': 'Station Name', 'label': 'Station Name:' },
                       { 'fieldName': 'SITE_NAME', 'tooltip': 'Site Name', 'label': 'Site Name:' },
                       { 'fieldName': 'STN_TYPE', 'tooltip': 'Station Type', 'label': 'Station Type:' }]
                     }];
0 Kudos