J'ai suivi tes recommandations :
Comment mettre à jour le tableau "stats" dynamiquement en sachant que les donnée sont présentes sous forme d'un fichier XML?
J'utilise actuellement ceci pour alimenter mon tableau :
<mx:Model id="model" source="ressources/test_statistique.xml"/>
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 51 52 53 54 55 56
| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="734" themeColor="#D8B735" alpha="1.0" borderStyle="solid" borderThickness="5" borderColor="#F34A0F"
applicationComplete="init()"
>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var stats:ArrayCollection;
private function init():void
{
stats = new ArrayCollection(model.statistique);
}
private function closeHandlerCbx():void {
//var sannee:String = ComboBox(event.target).selectedItem.label;
var annee:int = parseInt(anneeCbx.value.toString()) ;
var mois:int = parseInt(moisCbx.text) ;
searchItemByAAAAMM(annee,mois);
}
private function searchItemByAAAAMM(annee:int,mois:int):void {
<!-- Comment faire pour mettre a jour ?-->
stats = new ArrayCollection(model.statistique); <!-- ??????? -->
}
]]>
</mx:Script>
<mx:Model id="model" source="ressources/test_statistique.xml"/>
<mx:ComboBox id="anneeCbx" x="21" y="19" width="79" dataProvider="{annee}" labelField="name" close="closeHandlerCbx();" ></mx:ComboBox>
<mx:ComboBox id="moisCbx" x="105" y="19" width="109" dataProvider="{mois}" labelField="name" fillAlphas="[0.0, 0.0, 0.0, 0.0]"></mx:ComboBox>
<mx:Tree id="myTree" width="211" height="321" labelField="@label"
showRoot="false" dataProvider="{treeData}" x="21" y="76"/>
<mx:Panel x="250" y="76" title="Statistiques Mensuelles KparK" width="470" height="478" layout="absolute" visible="true">
<mx:TabNavigator id="tn" width="420" height="377" color="0x323232" x="10" y="26">
<!-- Define each panel using a VBox container. -->
<mx:VBox label="Semaine 1">
<mx:TileList id="tl1" name="tl1" dataProvider="{stats}" x="297" y="76" maxColumns="4" width="403" height="329" borderStyle="none" itemRenderer="statRender">
</mx:TileList>
</mx:VBox>
</mx:TabNavigator>
<mx:ComboBox x="22" y="10" width="111" dataProvider="{magasin}" labelField="name" ></mx:ComboBox>
</mx:Panel>
</mx:Application> |
Partager