2 Replies Latest reply on Nov 8, 2011 7:28 AM by Don Kerr

    List selectedItem inside GridItemEditor

    Don Kerr Level 3

      I have a List inside a GridItemEditor.  To make it reusable for many columns, I make the dataProvider and labelField variables, since they are different for each column. The labelField of the List typically matches the column.dataField .

       

      [Bindable] public var dp:ArrayCollection;

      [Bindable] public var lf:String;

       

      <s:TextInput id="t"  prompt="filter as you type" change="t_changeHandler(event)"/>

      <s:List id="l"   dataProvider="{dp}" labelField="{lf}">

       

      How do I return the value of the labelField property in l.selectedItem?  Typically, I have a fixed property (e.g. list.selectedItem.firstName), but in this case I need it to return the value of labelField as it varies by column.

       

      override public function get value():Object {

       

                                                                            return l.selectedItem[labelField]  ????; // don't know the syntax?

       

                                                                  }

       

      override public function save():Boolean

                                              {

       

                                                        data[column.dataField] = value;

       

      }

       

       

      Thanks,

      Don