0 Replies Latest reply on Oct 8, 2007 2:38 PM by mscholtz

    reference code-created child of container by name?

      Newbie alert! Been doing flex for about 2 weeks, so please excuse my cluelessness.

      I've got a grid in my main app file, and a script in that same file adds several rows to the grid (and then items etc to the rows). Each row is given a unique id upon creation.

      Once this is complete, I then want to be able to reference one of the rows by id, rather than by index. i.e. I want to be able to do gridx.getChildByName ("Row 1");

      However, it seems this sort of thing only works if the id was hard coded into an MXML tag as opposed to created via ActionSript?? Is that right?

      Because this works:

      var myRow:GridRow = GridRow ( gridx.getChildAt(1));

      and this doesn't:

      var myRow:GridRow = GridRow( gridx.getChildByName("Row 1"));

      even though I can verify that the id of the row returned by that first snippet is, in fact, "Row 1".

      What I want to avoid is having to refer to the dynamically-created rows by position as opposed to name.
      What am I missing here?

      Thanks much for any help!