1 Reply Latest reply on Jun 13, 2006 3:57 AM by Tolk

    Referencing a Specific Cell in DataGrid

    Tolk
      I know how to get a whole row / item using the dataGrid.getItemAt(); method. If i then wanted to reference a specific item from this how would you reference it?

      i.e If i had a 3 column by 2 row dataGrid and i used getItemAt(); to grab the item in row 1, how would i then get the value of the item in coloumn 1 of row 1.

      Hope that makes sense!

      Basically what i'm trying to do to help explain the situation:
      1) Grab the value of row x column 1 from a dataGrid
      2) Create a new textField with .text = dataGrid item pulled
      3) Assign the item in row x column 1 the value "" or Null
      4) Do some procedural animation with the textField

      I'm ok with parts 2) and 4), I'm sort of ok with part 3) (but when you use replaceItemAt(); it removes the values from all the columns in row x) and I'm stuck on 1) (explained above).

      Thanks for any help.

      P.s. the items in the dataGrid are loaded from an xml file via xml connector and dataset components, i know flash can't write directly to the xml file but it doesnt matter as i'm not wanting to write any of the changes made in the dataGrid to the xml file.
        • 1. Re: Referencing a Specific Cell in DataGrid
          Tolk Level 1
          Ok i worked out some of my problems but need more specific help now:

          I can select idividual cells using dataGrid.getItemAt(x).y
          where x = row index
          and y = name of the column

          How can i dynamically change which column is referecned i.e. i tried dataGrid.getItemAt(x).eval(columnnamevariable)
          but it doent seem to like it, is there another way?