1 Reply Latest reply on Aug 29, 2008 7:52 PM by Newsgroup_User

    Customized datagrid

    Cr99 Level 1
      I would like to implement a somewhat complicated version of a datagrid which would display the current information in each row via a customized object but at the same time allow the user to edit that data via comboboxes and colorpickers. Here is my datagrid so far:

      <mx:DataGrid color="black" fontSize="9" editable="true" rowCount="2" dataProvider="{axis.seriesList}" width="100%">
      <mx:columns>
      <mx:DataGridColumn width="40" dataField="color" headerText="Color"/>
      <mx:DataGridColumn dataField="name" headerText="Name"/>
      <mx:DataGridColumn dataField="type" headerText="Type"/>
      </mx:columns>
      </mx:DataGrid>

      I assume that I'll need to use custom itemRenderers to get the comboboxes and colorpickers into the different columns, But I'd also like each row in the database to be bound to a seperate SeriesObject in my ArrayCollection axis.seriesList. So how can I:

      A) add the custom datagrid renderers

      and

      B) get the changes the user makes in the comboboxes and colorpickers to update the values in their corresponeding SeriesObjects from my sereisList arraycollection?

      The SerisObject has a name:String, type:String, and a color:String and it's a simple actionscript data structure. I'd like to use a combobox for the name and type, and a colorpicker for the color. Also the types will be a pre-defined array which won't change, but the names has to be a dynamic array which I will update while the program is running. This makes it even more tricky to use with itemRenderers since I can't just write a generic one, I have to also pass it in the combobox items via an array.

      Thanks!