3 Replies Latest reply on Jul 18, 2007 2:43 AM by bortot

    DataGrid itemEditor with popup

    bortot
      I'm trying to write a custom itemEditor which should behave similarly to a dateField (free text input + popup to guided input form)
      The problem is, when I pop up the form the cell being edited exits from editing status.
      I tried handling the popup both via popUpButton and direct PopUpManager programming, to no extent.
      Could someone please tell me what do I have to do to get the expected behaviour?
        • 1. Re: DataGrid itemEditor with popup
          ntsiii Level 3
          Can you programaticlly "re-open" the cell for editing when the pop-up closes?

          It is having the direct edit capability that makes this complicated. If you can do without that, it will be easy.
          Tracy
          • 2. Re: DataGrid itemEditor with popup
            bortot Level 1
            thanks for your reply.

            The cell "closes" while the popup is still open, not when I close it.
            The latter would be perfectly normal, the very same way DateField behaves.
            It seems to me that the grid does not recognizes the popup as part of the item editor: thus moving focus to it triggers some event (whose type and target I don't know) that finally causes endEdit to be triggered (that I can trace).
            • 3. Re: DataGrid itemEditor with popup
              bortot Level 1
              I managed to simplify the problem enough to post an example:

              package components.conf.grid
              {
              import mx.containers.HBox;
              import mx.controls.TextInput;
              import mx.controls.PopUpButton;
              import mx.controls.NumericStepper;

              public class BogusEditor extends HBox
              {
              public function BogusEditor()
              {
              super();

              var text:TextInput = new TextInput;
              text.percentWidth = 100;
              var button:PopUpButton = new PopUpButton;
              button.popUp = new NumericStepper;

              this.addChild(text);
              this.addChild(button);
              }
              }
              }

              in this item editor (which is not supposed to really edit nothing, of course), when you pop up the numeric stepper and interact with it, the grid cell being edited exits from editing status while leaving the popup still open (and zombie...).
              Note that, if you use ie a DateChooser instead of the NumericStepper, everything works just fine.