Select to view content in your preferred language

AttributeInspector "No features selected"

573
1
03-27-2013 07:33 AM
ChrisRiver
New Contributor III
I am trying to instantiate the AttributeInspector after making a selection via featureLayer.selectFeatures()

featureLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(value)
    {
      var sel = layer.getSelectedFeatures();// test - this is returning the correct feature

      var inspectorOptions = [{
        'featureLayer':featureLayer,
        'isEditable': true,
        'showDeleteButton':false
      }];
      var attInsp = new esri.dijit.AttributeInspector({layerInfos:inspectorOptions},'editingContent');
dojo.connect(attInsp,'onAttributeChange',self.recordAttributeModification);
});


What I get is the attribute inspector with the "No features selected" text in it the first time I try to instantiate it. If I hit the edit button again (to trigger the preceding code block) the attribute inspector is populated with the expected form elements.

Anyone have any idea what I might be doing wrong?
0 Kudos
1 Reply
ChrisRiver
New Contributor III
Update (bump)

Anyone have any ideas?  Right now I can only get the attribute editor to display reliably by using a pretty scary hack...

      self.attributeInspector._currentFeature = sel;
      self.attributeInspector.refresh();
      self.attributeInspector.domNode.children[0].innerHTML = layer.name;
      self.attributeInspector.domNode.children[1].setAttribute('style','display:block;');
0 Kudos