bonjour,
j 'essaie de coder (en mxml) un datagrid.
mais voilà, j 'obtiens cette erreur:
initializer for 'columns', multiple initializer values for target type mx.collections.IList.
voici mon code
merci d'avance pour vos suggestions...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 <?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300" > <fx:Script> <![CDATA[ import mx.events.FlexEvent; private var vp:VideoProjection; private function click(e:MouseEvent):void { vp=new VideoProjection(); vp.addEventListener("completeAnnonces",filldata); } private function filldata(e:Event):void { annonces.dataProvider=vp.ar; } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:DataGrid id="annonces"> <s:columns> <mx:DataGridColumn headerText="ID" dataField="id"/> <!--erreur--> <mx:DataGridColumn headerText="Annonces" dataField="annonces"/> <!--erreur--> <mx:DataGridColumn headerText="Afficher" dataField="afficher"> <!--erreur--> <mx:itemRenderer> <fx:Component> <s:ComboBox> <s:ArrayCollection> <fx:Boolean>false</fx:Boolean> <fx:Boolean>true</fx:Boolean> </s:ArrayCollection> </s:ComboBox> </fx:Component> </mx:itemRenderer> </mx:DataGridColumn> </s:columns> </s:DataGrid> <s:Button x="320" y="10" label="refresh" click="click(event)"/> </s:Group>
Partager