DataGrid ItemEditor with Two Input Fields

| 4 Comments

Several folks have been asking about how to have a DataGrid ItemEditor with two input fields (say you want to separately edit first name and last name or something like that).

It's a bit tricky because of some missing pieces in the underlying Flash focus APIs and because of how Focus events work. Here is my take on how to do it. Usual caveats apply (i.e, code is not supported and may have bugs etc).

Download Source
Run Example

4 Comments

very nice!!
good work.

Interesting that "createChildren" gets called everytime you click on the cell.

I modified yours a little bit to use two comboboxes and I was wondering why in "commitProperties" my comboboxes "dataProviders" were always empty even though I had set them once before :)

----------------
Alex responds:

Editors get re-created every time. I haven't proven it yet, but I think you could create a custom IFactory that recycles a single editor instance

How can I specify background color to the footer? I tried using beginFill function of the Shape, but no luck.

-------------------
Alex responds:

Try the graphics object in the footer.

Can something similar be done with a TileList TextInput ItemRenderer - i can't seem to get tabbing to work.

-----------------------
Alex responds:

TileList doesn't support editing. You'ld have to add all of that code first.

Leave a comment


Type the characters you see in the picture above.

About this Entry

This page contains a single entry by Alex Harui published on August 4, 2008 4:12 PM.

Flex 3.x Versioning and Portals was the previous entry in this blog.

DataGrid With PopUp Editor is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.