ItemRenderer for DataGrid

Here's a nice problem
Please test the code below.
As you will see, it works fine! The scores (7) are presented neatly. That's because in the itemRenderer for column 2, I bind the text property to
data.item2.score.
BUT
In my application, I DON'T KNOW WHAT THIS PROPERTY WILL BE because the dataProvider is generated dynamically. The names of the properties are generated dynamically using a prefix ("item") and a suffix which is an id from the database. So the dataProvider could hold the props 'item325' and 'item23' and so on...
What I want to do is to store the name of the property in the labelField of the column (as I did in the example). The itemRenderer should now get its data using that labelField.
In my ItemRenderer which says now 'text="{data.item2.score}"' should be 'text="{data[referenceToLabelField].score}"'
Any Ideas?
thx;
d
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            [Bindable]
            private var dp:ArrayCollection = new ArrayCollection();
            private function init():void
                var a:Array = new Array();
                for (var i:int = 0; i < 10; i++)
                    a.push({pupil: "Pupil " + i, item2: {score: 7}});
                dp.source = a;
        ]]>
    </mx:Script>
    <mx:DataGrid dataProvider="{dp}">
        <mx:columns>
            <mx:DataGridColumn headerText="Column 1" dataField="pupil" width="200"/>
            <mx:DataGridColumn headerText="Column 2" dataField="item2" width="200">
                <mx:itemRenderer>
                    <mx:Component>
                        <mx:Label text="{data.item2.score}" width="10"/>
                    </mx:Component>
                </mx:itemRenderer>
            </mx:DataGridColumn>
        </mx:columns>
    </mx:DataGrid>
</mx:Application>

The project I'm working on is a school test generator. I created a test generator. Let's say I create a test named "Final exam". In this test I link a student group and I add as much testItems as I want. Let's say I make 2 testItems named "Written result" and "Attendance during schoolyear". Now, my application will generate scores for each student and for each item.
We'll generate a dataGrid as:
                    Written result          Attendance during schoolyear
Pupil 1               7                                   5
Pupil 2               6                                   9
Pupil 3               8                                   2
In this simple example, my dataProvider could look like this:
{pupil: "Pupil 1", score1: 7, score2: 5},
{pupil: "Pupil 2", score1: 6, score2: 9},
{pupil: "Pupil 3", score1: 8, score2: 2}
Setting the labelField to 'score1' and 'score2' will work.
So far, so good! My problem however is that the scores are not just figures but Objects! Why? Because my system makes it possible to VIEW the scores in diffrent ways, such as figures, smileys, checkboxes etc. The diffrent columns in my grid will each have a diffrent itemRenderer. The itemRenderers will take properties from their dataObject to render the output. My dataProvider looks like:
{pupil: "Pupil 1", score1: {score: 7, foo: 'whatever'}, score2: {score: 5, foo: 'whatever'}},
{pupil: "Pupil 2", score1: {score: 6, foo: 'whatever'}, score2: {score: 9, foo: 'whatever'}},
{pupil: "Pupil 3", score1: {score: 8, foo: 'whatever'}, score2: {score: 2, foo: 'whatever'}}
Setting the labelField to 'score1' and 'score2' won't work!
The data property for the itemRenderer of column 2 should be
     {score: 7, foo: 'whatever'}
instead of
     {pupil: "Pupil 1", score1: {score: 7, foo: 'whatever'}, score2: {score: 5, foo: 'whatever'}}
Does that make things clearer?
Thx,
d

Similar Messages

  • Item Renderer for DataGrid

    I have a button component as a Item renderer in the column of
    the datagrid .
    I am not able to access the Itemrenderer component(which I
    declared in other mxml file in the datagrid)
    This is the data grid where I have the Itemrenderer:
    <mx:DataGrid id="dgCondition1"
    variableRowHeight="true" width="100%" height="150"
    verticalScrollPolicy="auto" editable="true"
    dataProvider="{initDataGrid_Create}" >
    <mx:columns>
    <mx:DataGridColumn headerText="" dataField="conditi"
    />
    <mx:DataGridColumn headerText="Condition"
    dataField="syntax" width="300" />
    <mx:DataGridColumn headerText="1" dataField="value"
    width="80" editable="false" itemRenderer="buttonRenderer"/>
    <mx:DataGridColumn dataField="value" headerText="2"
    itemRenderer="buttonRenderer" />
    I created a new mxml component for this button component
    .(buttonRenderer.mxml)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="400" height="300">
    <mx:Script source="..TableDataGridBtn.as" />
    <mx:Button id="col1" label="" width="75"
    click="getDetail(event,col1)" />
    </mx:VBox>
    The Problem is I am not able to access the buttonRenderer in
    the datagrid itemRenderer tag .
    It says "Access of Undefined Property buttonRenderer".

    "nash99" <[email protected]> wrote in
    message
    news:g7alc5$nkd$[email protected]..
    > So
    > Is it that I can Use this ItemRenderer tag in the
    Application Tags only
    > Is there any other way I can use them in mxml components
    because I am
    > using
    > the same button in 16 datagrid columns , I dont wan't to
    make the code
    > look
    > redundant.
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=intro_3.html

  • Re:Item renderer AS3 for datagrid

    I am having a data grid with multiple check boxes for this i am using CheckCellRendererEdit as itemrenderer.When i am making a change in datagrid checkbox its not updating
    The problems are
    1. when i select a checkbox in second row it gets selected in another  row after saving
    2.when i choose one checkbox in a row it gets afftected in many row can i get a solution for this Below given is the code i am using
    CheckCellRendererEdit.as
    package
        import mx.controls.*;
    import mx.core.*;
    import mx.controls.dataGridClasses.DataGridListData;
    import flash.events.Event;
    import flash.events.MouseEvent;
    public class CheckCellRendererEdit extends CheckBox
    // Define the constructor and set properties.
    public function CheckCellRendererEdit() {
        super();
    override protected function clickHandler(event:MouseEvent):void
                if (!enabled)
                {    //DataGrid(this.parentDocument.dg).selectedItem.vdata=CheckBox(event.currentTarget).selec ted;
                        event.stopImmediatePropagation();
                        return;
                if (toggle)
                    selected = !selected;

    Currently i am migrating from flex1.5 to flex2 Just i am using this itemrenderer(checkbox) for DataGrid can i have some ideas for datagrid
    The DataGrid i am using is
    <mx:DataGrid id="screendg" ">
                <mx:columns>
                  <mx:Array>
                    <mx:DataGridColumn headerText="mdata" dataField="screenid" editable="false" />
                    <mx:DataGridColumn headerText="data" dataField="mdata" itemRenderer="CheckCellRendererEdit"  />
                    <mx:DataGridColumn headerText="mdata" dataField="vdata" itemRenderer="CheckCellRendererEdit"  />
                    <mx:DataGridColumn headerText="cdata" dataField="cdata" itemRenderer="CheckCellRendererEdit"  />
                    <mx:DataGridColumn headerText="vdata" dataField="udata" itemRenderer="CheckCellRendererEdit"  />
                </mx:Array>
                </mx:columns>
              </mx:DataGrid>
    When i am selecting a checkbox in data grid the grid value is not getting changed

  • Tooltip for datagrid's cells

    I know how to create a tooltip for datagrid and/or its
    columns. Is it possible to create a tooltip (or something similar)
    for each cell? So whenever the mouse is over a certain cell, a tip
    would be shown for that cell that depends on the value of the cell.
    Similar functionality can often be seen in web-based database apps:
    an Ajax query gets related data from a database on mouseOver.
    My need and idea is to
    - show a simple text list as a tooltip
    - the text would be fetched from a database via a web service
    - the fetch would be based on datagrid's (hidden) rowid and
    each column's (hidden) column id (which are real database columns)
    - the database structure is an n:m relation i.e. one
    rowid+colid can refer to several items that are then used in the
    tooltip
    Use case: A number is displayed in the datagrid. The need is
    to display 0-n references related to that specific figure (e.g.
    book names, notes etc) in the tooltip. Next cell's tooltip would be
    showing different references.
    Anybody any ideas or suggestions? Thanks!

    Hi,
    Did you try creating a custom itemRenderer and handling the
    mouse events for that item renderer component. There is also a
    property called dataTipFunction, please check that too.
    Hope this helps.

  • Individual itemRenderer for each item in TileList

    I currently have a tilelist with 6 items in it. I would like each item to be renderered slightly different. I know I can set the itemRenderer attribute of TileList but is it possible to set a different itemRenderer for each individual Object in the TileList?
    My code currently looks like this:
    <mx:TileList itemRenderer="myContainer1">
         <Object />
         <Object />
         <Object />
         <Object />
         <Object />
         <Object />
    </mx:TileList>

    Yes you can assign different components per row,
    use <ViewStack..
                 <HBox1 />
                 <HBox2 />
                 <HBox3 /> & so on..
    selectedIndex for ViewStack you can specify as per requirement like you can maintain internally rowIndex 0 to n & this you can assign to ViewStack
    selectedIndex={data.rowIndex}

  • Eventlistener for datagrid

    what is the eventlistener for datagrid when im clicking a cell then trace cell's value?
    how to get a selected row index and collumn index?

    http://kirill-poletaev.blogspot.com/2011/01/as3-datagrid-component-part-10.html

  • When labelFunction for datagrid is called?

    I have a datagrid with three columns, and there is a
    labelFunction for one of the columns.
    I add a breakpoint in side of the labelFunction, I found that
    the labelFunction is called 4 times.
    when labelFunction for datagrid column is called? why there
    is so many calls of labelFunction
    PS:
    I set data provider for datagrid in creationComplete event of
    the datagrid, and the data provider just contains one item.

    labelFunction is called for every row/item, and for each
    column that has the labelFunction specified.
    Sometimes I have found the label function is called with a
    null item. I am in the habit of checking for null in all
    labelFunctions.
    Tracy

  • Proper URL for LinkButton in itemRenderer within datagrid

    I am having problems figuring out the best way to open a URL
    using the LinkButton function within an itemRenderer under a
    DataGridColumn. I use a HTTPService to call a PHP script to pull
    data from a MySQL database. The datagrid fills in properly and all
    the data is being displayed. The link button works in that it will
    open a new browser (if I put in a fake URL without my required
    data).
    Below is an example of my column with the link button and the
    URL I'm tring to open.
    <mx:DataGridColumn headerText="Script ID"
    dataField="scriptid">
    <mx:itemRenderer>
    <mx:Component>
    <mx:LinkButton label="{data.scriptid}"
    click="navigateToURL(new URLRequest('
    http://remoteurl/index.php?file=ext&id='data.scriptid),
    '_blank')"/>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    The error that I get is this:
    The reference to entity "id" must end with the ';' delimiter.
    It's like Flex Builder thinks that the "id" in the URL is a
    parameter for the control? I tried enclosing the data.scriptid
    within the single quotes. I also tried putting curly brackets {}
    around data.scriptid as well.
    Any assistance would be appreciated.
    Thanks,
    Chris

    Spark DataGrid or MX DataGrid?

  • Using a custom itemrenderer in datagrid to update value in the same row but different column/cell

    Here's what I have so far.  I have one datagrid (dg1) with enable drag and another datagrid (dg2) with dropenabled.  Column3 (col3) of dg2 also has a custom intemrenderer that's just a hslider.
    When an item from dg1 is dropped on dg2, a custom popup appears that asks you to use the slider in the popup to set a stress level.  Click ok and dg2 is populated with dg1's item as well as the value you selected from the popup window.  I was also setting a sliderTemp variable that was bound to the itemrender slider to set it but that's obviously causing issues as well where all the itemrenderer sliders will change to the latest value and I don't want that.
    What is needed from this setup is when you click ok from the popup window, the value you choose from the slider goes into dg2 (that's working) AND the intemrenderer slider needs to be set to that value as well.  Then, if you used the intemrenderer slider you can change the numeric value in the adjacent column (col2).   I just dont know how to hook up the itemrenderer slider to correspond with that numeric value (thatds be in col2 on that row);
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600"
                        xmlns:viewStackEffects="org.efflex.mx.viewStackEffects.*" backgroundColor="#FFFFFF" creationComplete="init(event)"
                        xmlns:components="components.*" xmlns:local="*">
         <mx:Script>
              <![CDATA[
                   import mx.binding.utils.ChangeWatcher;
                   import mx.collections.ArrayCollection;
                   import mx.controls.Alert;
                   import mx.controls.TextInput;
                   import mx.core.DragSource;
                   import mx.core.IUIComponent;
                   import mx.events.CloseEvent;
                   import mx.events.DataGridEvent;
                   import mx.events.DragEvent;
                   import mx.events.FlexEvent;
                   import mx.events.ListEvent;
                   import mx.events.SliderEvent;
                   import mx.events.SliderEventClickTarget;
                   import mx.managers.DragManager;
                   import mx.managers.PopUpManager;
                   import mx.utils.ObjectUtil;
                   [Bindable]private var myDP1:ArrayCollection;
                   [Bindable]private var myDP2:ArrayCollection;
                   [Bindable]public var temp:String;
                   [Bindable]public var slideTemp:Number;
                   private var win:Dialog;     
                   protected function init(event:FlexEvent):void{
                        myDP1 = new ArrayCollection([{col1:'Separation from friends and family due to deployment'},{col1:'Combat'},{col1:'Divorce'},{col1:'Marriage'},
                             {col1:'Loss of job'},{col1:'Death of a comrade'},{col1:'Retirement'},{col1:'Pregnancey'},
                             {col1:'Becoming a parent'},{col1:'Injury from an attack'},{col1:'Death of a loved one'},{col1:'Marital separation'},
                             {col1:'Unwanted sexual experience'},{col1:'Other personal injury or illness'}])
                        myDP2 = new ArrayCollection()
                   protected function button1_clickHandler(event:MouseEvent):void
                        event.preventDefault();
                        if(txt.text != "")
                             Alert.yesLabel = "ok";                    
                             Alert.show("", "Enter Stress Level", 3, this,txtClickHandler);
                   private function image_dragEnter(evt:DragEvent):void {
                        var obj:IUIComponent = IUIComponent(evt.currentTarget);
                        DragManager.acceptDragDrop(obj);
                   private function image_dragDrop(evt:DragEvent):void {
                        var item:Object = dg2.selectedItem;                    
                        var idx:int = myDP2.getItemIndex(item);
                        myDP2.removeItemAt(idx);
                   protected function dg1_changeHandler(event:ListEvent):void
                        temp=event.itemRenderer.data.col1;     
                   protected function dg2_dragDropHandler(event:DragEvent):void
                        event.preventDefault();                         
                        dg2.hideDropFeedback(event as DragEvent)
                        var win:Dialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
                        win.btn.addEventListener(MouseEvent.CLICK, addIt);
                        PopUpManager.centerPopUp(win);                              
                        win.mySlide.addEventListener(Event.CHANGE, slideIt);
                   private function txtClickHandler(event:CloseEvent):void {
                        trace("alert");
                        if (event.detail==Alert.YES){
                             myDP2.addItem({label:temp});
                   private function addIt(event:MouseEvent):void{                    
                        myDP2.addItem({col1:temp, col2:slideTemp})
                   private function slideIt(event:SliderEvent):void{                    
                        slideTemp = event.target.value;               
              ]]>
         </mx:Script>
                   <mx:Panel x="10" y="10" width="906" height="481" layout="absolute">
                        <mx:Image x="812" y="367" source="assets/woofie.png" width="64" height="64" dragDrop="image_dragDrop(event);" dragEnter="image_dragEnter(event);"/>
                        <mx:DataGrid x="14" y="81" width="307" height="251" dragEnabled="true" id="dg1" dataProvider="{myDP1}" wordWrap="true" variableRowHeight="true" change="dg1_changeHandler(event)">
                             <mx:columns>
                                  <mx:DataGridColumn headerText="Examples of Life Events" dataField="col1"/>
                             </mx:columns>
                        </mx:DataGrid>
                        <mx:DataGrid x="329" y="81" height="351" width="475" dragEnabled="true" dropEnabled="true" id="dg2"
                                        wordWrap="true" variableRowHeight="true" dataProvider="{myDP2}" editable="true"
                                        dragDrop="dg2_dragDropHandler(event)"  rowHeight="50" verticalGridLines="false" horizontalGridLines="true" >
                             <mx:columns>
                                  <mx:DataGridColumn headerText="Stressor" dataField="col1" width="300" wordWrap="true" editable="false">
                                  </mx:DataGridColumn>
                                  <mx:DataGridColumn headerText="Stress Level" dataField="col2" width="82" editable="false"/>
                                  <mx:DataGridColumn headerText="Indicator" dataField="col3" width="175" paddingLeft="0" paddingRight="0" wordWrap="true" editable="false">
                                       <mx:itemRenderer>
                                            <mx:Component>
                                                 <components:Compslide/>
                                            </mx:Component>
                                       </mx:itemRenderer>
                                  </mx:DataGridColumn>
                             </mx:columns>
                        </mx:DataGrid>                    
                        <mx:Text x="14" y="10" text="The first category of underlying stressors is called Life Events. The list includes both positive and negative changes that individuals experience. Both can be stressful. For example, becoming a parent is usually viewed as a positive thing, but it also involves many new responsibilities that can cause stress. " width="581" height="73" fontSize="12"/>
                        <mx:TextInput x="10" y="380" width="311" id="txt"/>
                        <mx:Text x="10" y="335" text="Add events to your list that are not represented in the example list.  Type and click &quot;Add to List&quot;&#xa;" width="311" height="51" fontSize="12"/>
                        <mx:Button x="234" y="410" label="Add to List" click="button1_clickHandler(event)"/>
                   </mx:Panel>     
    </mx:Application>

    how do i go about doing that?  do i put a change event function in the itemrenderer?  and how would i eventually reference data.col2?

  • Dynamic setting of itemRenderer in datagrid

    Can we dynamically set the itemrenderer in a datagrid
    depending upon some value in data?

    HI,
    how about to display different controls in a rows for that column? Can it be done?
    Thanks,,
    -jenue

  • How to get AdvancedDataGrid ItemRenderer for hierarchal column to work

    I have an advanced datagrid with 5 columns one of which is a
    hierarchal (tree). This datagrid is populated by the following:
    MyAdvancedDataGrid.dataProvider = new
    HierarchicalData(MyXMLListCollection);
    The first column is the tree and im trying to do a item
    renderer on it in actionscript... I have the following code:
    MyTreeColumn.itemRenderer = new ClassFactory(MyRenderer);
    In order to get the icon and label to show up i need to
    extend AdvancedDataGridGroupItemRenderer as such:
    MyRenderer extends AdvancedDataGridGroupItemRenderer
    This has one problem... the updateDisplayList function only
    gets fired for the children not the root rows... So if you set the
    this.icon.visible = false... the icon will show up on the root rows
    but the most bottom children rows the icon will become invisible...
    Now ... if i extend the class with
    AdvancedDataGridItemRenderer then the tree functionality gets
    overwritten and it doesn't function the way that I need it to..
    Ultimately I'm trying to shift the default label over so I can add
    another icon to the right of the the default icon so the user can
    click on it... Any help from anyone would be greatly
    appreciated...

    var column:AdvancedDataGridColumn;
    column = new AdvancedDataGridColumn("HeaderName");
    column.width = 10;
    column.dataField = "@label";
    column.itemRenderer = new ClassFactory(MyItemRenderer);
    MyAdvancedDataGrid.columns = [column];
    code for MyItemRenderer:
    package {
    import mx.controls.dataGridClasses.DataGridListData;
    import mx.controls.listClasses.BaseListData;
    import mx.controls.listClasses.IDropInListItemRenderer;
    import mx.controls.listClasses.IListItemRenderer;
    import mx.core.UIComponent;
    public class MyItemRenderer extends UIComponent implements
    IDropInListItemRenderer, IListItemRenderer {
    //class variables
    private var _ListData:DataGridListData = null;
    private var _data:Object = null;
    public function PE_BaseRenderer() {
    super();
    public function get listData():BaseListData {
    return _ListData;
    public function set listData(value:BaseListData):void {
    _ListData = value as DataGridListData;
    public function get data():Object {
    return _data;
    public function set data(value:Object):void {
    _data = value;
    invalidateProperties ();
    override protected function createChildren():void {
    super.createChildren();
    //create you children here
    } //end of class declaration
    } //end of package declaration
    Within this renderer you can create whatever type of children
    you want for the datagrid column

  • ItemRenderer and DataGrid Problem

    Hi guys.
    I'm on creating a small app that simply pulls information
    from an XML file, displays it in a DataGrid then allows the user to
    filter and search it. First things first though; I'll explain what
    I have so far then detail my problem.
    I get the XML file via HTTPService then place the results in
    a Bindable ArrayCollection. When the Datagrid's source is set to
    that ArrayCollection it works fine. What I am initially trying to
    do is use an itemRenderer in one of the columns that displays lines
    of text depending on the values of the current row.
    For example, the structure of my XML file is (roughly):
    <content>
    <name>Name1</name>
    <description>Description Goes Here</description>
    <audience1>yes</audience1>
    <audience2>no</audience2>
    <audience3>yes</audience3>
    </content>
    So what I am trying to do is group the audiences that each
    piece of "content" has a yes value to. So under the "Audiences"
    column in the datagrid, the above content would say
    "Audience1
    Audience3"
    as it has a yes value in between audience 1 and 3. I've tried
    writing very basic code within the itemRenderer whereby I override
    the public function set data and do some checks there but it never
    seems to work right. I've tried using Arrays within that to store
    the current audiences but I clearly haven't got the right format
    for that.
    There must be a more efficient way of doing this. I'm fairly
    new to both Flex and AS3 (been using AS2 quite a while now) but I
    have a feeling there would be some way to store each row's audience
    list in an array/object/model so I can refer to it later (I'm
    intending to filter these results by audience type later so I think
    I will HAVE to do it this way eventually). I've read quite a few
    tutorials and guides but I honestly don't know where to look
    anymore, none of them seem to cover this specific problem.
    I hope this makes sense to you guys and any guidance you
    could give me would be greatly appreciated.
    Cheers

    LabelFunction produces a display-only column.
    To filter, you will need to use the underlying data.
    Another solution to consider is to create a custom item
    class. Loop over the xmllist and build instances of the class,
    populating the properties from the xml.
    have a property who's value is calculated based on the
    audience properties values. Since it is a "real" data property in
    each item, you can filter on it directly.
    Tracy

  • Move focus from one to another itemRenderer inside DataGrid itemRenderer

    I have a mx: DataGrid with 4 columns that have a itemRenderer with the following settings:
    - Mx:DataGrid:
    <code>
    <mx:DataGrid id="itensPedidoCompraList"
          width="100%"
    height="120"   
    dataProvider="{ model.pedidoCompra.itens }"
    editable="true"
    itemEditEnd="itensPedidoCompraList_itemEditEndHandler(event)">
    </code>
    - Mx:DataGridColumn:
    <code>
    <mx:DataGridColumn headerText="{resourceManager.getString('cadastroPedidoCompra', 'ident.PercentualDesconto') }"
                       width="60"
                       textAlign="right"
                       rendererIsEditor="true"
                                          editorDataField="data">
          <mx:itemRenderer>
                     <fx:Component>
                           <mx:Canvas>
                                     <input:NumberInput width="55"                                                                number="@{ data.percentualDesconto }"/>
                           </mx:Canvas>
                </fx:Component>
          </mx:itemRenderer>
      </mx:DataGridColumn>
    </code>
    The user clicks on the line of the grid and click on the column to edit.
    After him change or add value, ENTER key and have to move the focus to another column in the same line.
    The way I'm doing, is moving to the column below.
    What is the best way to do to move to the right column?
    thank you

    Try adding a capture phase event listener to DataGrid for keyDown and changing the key from ENTER to TAB

  • Multi-Use Item Renderer for DataGrid Column

    I have a dataGrid where the first column of the grid displays
    an icon for the 'type' of item in the row. I created a custom
    itemRenderer component which I reference in its own namespace, and
    everything works great. Since this is a pretty common concept, I'd
    thought that I'd be able to re-use that itemRenderer throughout the
    application, but everytime I try to call the itemRenderer in
    another dataGrid, I get 2 errors saying "the inlineComponent could
    not be found" and then because of that "Access of undefined
    property".
    It doesn't make sense for an itemRenderer to be only good for
    one use, so I'm obviously missing some fundamental issue. Can
    someone enlighten me?

    Hah, found it. It is an mxml example, and implements
    IDropInListItemRenderer. It for an image renderer, but you will be
    able to see what to do.
    Tracy
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalAlign="center" verticalAlign="middle"
    width="16" height="16"
    implements="mx.controls.listClasses.IDropInListItemRenderer"
    >
    <mx:Script><![CDATA[
    import mx.controls.listClasses.IDropInListItemRenderer;
    import mx.controls.listClasses.BaseListData;
    import mx.controls.dataGridClasses.DataGridListData;
    import mx.controls.DataGrid;
    [Bindable]
    private var source:String;
    private var _listData:BaseListData;
    public function get listData():BaseListData
    return _listData;
    public function set listData(value:BaseListData):void
    _listData = value;
    invalidateProperties();
    override protected function commitProperties():void
    super.commitProperties();
    if (_listData is DataGridListData)
    var dgld:DataGridListData = _listData as DataGridListData;
    source =
    data[DataGrid(dgld.owner).columns[dgld.columnIndex].dataField];
    ]]></mx:Script>
    <mx:Image source="{source}"/>
    </mx:VBox>

  • Fire itemrenderer in datagrid

    Hi All,
    I am adding a row in my datagrid dynamically using an external button but couple columns contain a combo box as itemrenderer.
    The first item (index 0) in my comboBox have option "---select---".
    How can I set this first index for both comboBox item renderers after I add the new row?
    Thanks

    Hello RootSounds,
    Good to hear from you again. Well yes, your understanding is correct.
    How do i do that?
    Bo

Maybe you are looking for

  • How do i cancel my icloud account

    I canceled it off each of my devices. Now I want to cancel the account altogether. Music keeps showing up tagged in my itunes store with the cloud next to it. Also, it is still on my computer. I don't want to use icloud. It did not work the way I wan

  • Help with buttons loading sections. Code looks awkward!

    Hi everyone! I have a class that creates a navBar with some buttons. Each button loads an external .swf and everything is working just fine BUT the code is really awkward. I also wanted to use TweenLite to add transitions from section to section. I a

  • Error in import data using datapump

    Hi all, I just install oracle 10gR2 in my local machine and tryied to import data in 9iR2 database. But it ended with errors. Here r the steps I have followed.

  • Does BAM works with only Oracle database at the backend.

    Hi, I was wondering if Oracle Bussiness Activity Monitor(BAM) implemented within ADF application works with Oracle database as Oracle database is one of the very few databases supporting Database Change Notification? Or can it be implemented using My

  • Cant drag and drop in windows 7

    cant drag and drop in windows 7 with itunes