Hi, I have a problem with the focus behavior in the advancedDataGrid
with a custom itemrenderer that is also an itemEditor.

I have rows with variable height and itemrenderers that depending on
the state of the object must be editable.

The focus is working strange. I am overriding the DrawFocus() as I saw
in the examples, but I must click twice on an itemEditor for this one
to have focus. It seems that the first time the focus is "stolen" by
the grid itself, not the cell editor.

Also, when clicking on the cells, the content is selected (highlighted
in black). This would be ok if the cell that had the focus before
became unselected. Instead, both cells have their content selected and
highlighted in black.

I attach some code to give you an idea of what I'm doing:

<mx:Canvas focusEnabled="true" tabEnabled="true" 
  xmlns:mx="http://www.adobe.com/2006/mxml"; width="100%" 
  height="100%" 
  implements="mx.managers.IFocusManagerComponent" 
 >
 <mx:Label text="100" id="lblPrice"  />
 <mx:TextInput restrict="0-9." id="txtInput" />

...
      override public function drawFocus(isFocused:Boolean):void
      {
         if (lblPrice.visible)
          {
            lblPrice.setFocus();
          }
         else
          {
            txtInput.setFocus();
          }
      }
...

      /**
      * Toggles render visibility
      */
      private function toggleEdit(e: Event): void
      {
        if (editMode)
           txtInput.visible = true;
        else
           lblPrice.visible = true;
      }


Reply via email to