views:

26

answers:

4

Hi,

I'm trying to get this code working, any help would be greatly appreciated.

<mx:DataGrid x="359" y="221" width="623" height="176"> <mx:dataProvider>   <fx:Object name="Garbage Collection" code="7777" hours="2"/>   <fx:Object name="Road Repair" code="8888" hours="6"/>   <fx:Object name="Lawn Maintenance" code="9999" hours="12"/> </mx:dataProvider> <mx:columns> <mx:DataGridColumn headerText="Column 1" dataField="name"/> <mx:DataGridColumn headerText="Column 2" dataField="code"/> <mx:DataGridColumn headerText="Column 3" dataField="hours"/> </mx:columns> </mx:DataGrid>

I even don't have he header text in my columns ... I really don't understand.

Thank

Pierre

A: 

<mx:DataGrid x="359" y="221" width="623" height="176"> <mx:dataProvider>   <fx:Object name="Garbage Collection" code="7777" hours="2"/>   <fx:Object name="Road Repair" code="8888" hours="6"/>   <fx:Object name="Lawn Maintenance" code="9999" hours="12"/> </mx:dataProvider> <mx:columns> <mx:DataGridColumn headerText="Column 1" dataField="name"/> <mx:DataGridColumn headerText="Column 2" dataField="code"/> <mx:DataGridColumn headerText="Column 3" dataField="hours"/> </mx:columns> </mx:DataGrid>

Kangt_qc
this is the code I have right now
Kangt_qc
A: 

Try wrapping your <fx:Object />'s in an Array:

<mx:dataProvider>
    <mx:Array>
        <fx:Object />
    </mx:Array>
</mx:dataProvider>
clownbaby
Hi,nop it doesn't work
Kangt_qc
A: 

This is the code I have right now :

<mx:DataGrid x="359" y="221" width="623" height="176">
        <mx:dataProvider>
            <fx:Array>
                <fx:Object name="test" code="1234" hours="34"/>
                <fx:Object name="test2" code="1234" hours="34"/>
                <fx:Object name="test3" code="1234" hours="34"/>
            </fx:Array>
        </mx:dataProvider>
        <mx:columns>
            <mx:DataGridColumn headerText="Column 1" dataField="name"/>
            <mx:DataGridColumn headerText="Column 2" dataField="code"/>
            <mx:DataGridColumn headerText="Column 3" dataField="hours"/>
        </mx:columns>

I really don't understand why I can't have at least the headerText to work :(

TIA

Kangt_qc
If you make everything come from the same library (i.e. change all the fx to mx) does it still fail to work?
Gregor Kiddie
A: 

You don't need the <fx:Array> regarding to Adobe: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/DataGrid.html?filter_flex=4.1&amp;filter_flashplayer=10.1&amp;filter_air=2 But it should also work with an array. Is the dataProvider attribut of your DataGrid set, when you debug your application?

hering
Hi,Actually I used en embedded font ... and the itemrenderer wasn't able to use it !
Kangt_qc
Thanks for all.
Kangt_qc