2 Replies Latest reply on Jul 7, 2009 7:34 PM by alan_lindsay

    Flash8 AS2 - Searching a datagrid

    alan_lindsay Level 1

      I have a 2 column datagrid which is loaded via flashremoting. I can work with cells when they are clicked, using a listener, but I need to search a column for a string and I can't seem to find the syntax on the web (or perhaps I don't understand what I'm seeing). I'm sure it isn't difficult but if someone could point the way, I'd be most appreciative.

        • 1. Re: Flash8 AS2 - Searching a datagrid
          alan_lindsay Level 1

          There seems to be a great reluctance to respond to my question - is it so trivial that it shouldn't be dignified by a response or so complex that even the guru's are stumped (and I find THAT hard to believe)?

           

          I continue to search the web and experiment and have moved forward a little. If a cell in the grid is clicked, I can extract the value contained in that cell but I need to be able to scan cells looking for a value that matches some specific text. One web reference led me to the following:

           

          var colname = _root.userGrid.getColumnAt(0).columnName;

          trace(colname);

           

          gives me the name of the first column (there are 2 columns).

           

          var cellData:String = _root.userGrid.getItemAt(1).colname;

          trace(cellData);

           

          gives me 'undefined' instead of the contents that I can extract if I click on the 2nd cell of the first column. Where am I going wrong?

          • 2. Re: Flash8 AS2 - Searching a datagrid : SOLVED!
            alan_lindsay Level 1

            As I suspected, the answer was quite simple though not obvious to me - an indicator of my knowledge and understanding level.

             

            The name of the column I was trying to retrieve data from is "UserName" so if it change my original statement of:

             

            var cellData:String = _root.userGrid.getItemAt(1).colname;

             

            to

             

            var cellData:String = _root.userGrid.getItemAt(1).UserName;

             

            It works!