Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flex
Flex Forum d'entraide sur la programmation Adobe Flex : applications Internet riches (RIA)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 06/04/2011, 21h29   #1
Invité de passage
 
Homme
Inscription : avril 2011
Messages : 1
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Canada

Informations forums :
Inscription : avril 2011
Messages : 1
Points : 0
Points : 0
Par défaut Lenteur dans le chargement d'une AdvancedDataGrid avec une AdvancedDataGridColumn contenant des icones de 3k

salut,
j'ai une advancedDataGrid avec 7 colonnes de text et une colonne contenant des icones de 3k. Quand je charge une page d'une centaine de rows, les icones prennent énormément de temps pour s'afficher.
Y-a-t-il moyen d'accélérer l'affichage?
Merci
Voici le code :
- le mxml :

Code :
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
 
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="init()">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import com.test.Purchase;
import mx.controls.Alert;
 
 
[Bindable]
public var modified:Boolean=false;
 
 
[Bindable]
public var myAC:ArrayCollection = new ArrayCollection();
public function init() :void {
	var aPurchase:Purchase=new Purchase();
	var anotherPurchase:Purchase= new Purchase();
	aPurchase.id=120;
	aPurchase.category="category1";
	aPurchase.name="advantage 2";
	aPurchase.icon="..\\assets\\coeur_rouge.png";
 
	myAC.addItem(aPurchase);
 
	anotherPurchase.id=220;
	anotherPurchase.category="category2";
	anotherPurchase.name="Nintendo DS";
	anotherPurchase.icon="..\\assets\\coeur_gris.png";
	myAC.addItem(anotherPurchase);
}
 
 
 
]]>
</mx:Script>
 
 
<mx:AdvancedDataGrid id="dg" width="500" height="150" dataProvider="{myAC}">
<mx:groupedColumns>
<mx:AdvancedDataGridColumn dataField="id"   headerText="ID" width="300" />
<mx:AdvancedDataGridColumn dataField="category"   headerText="Category" width="400" />
<mx:AdvancedDataGridColumn dataField="name"   headerText="Name" width="400" />
<mx:AdvancedDataGridColumn headerText="favorite" width="400">     
	<mx:itemRenderer>         
	<mx:Component>   
	<mx:Image source="{data.icon}" width="60"/>
	</mx:Component>
 
	</mx:itemRenderer>
</mx:AdvancedDataGridColumn>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
</mx:Application>
- la classe entité

Code :
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
57
 
package com.test
{
	public class Purchase
	{
	 public function Purchase() { }
        private var _id:int = -1;
        private var _category:String = null;
        private var _productName:String = null;               
        private var _icon:String=null;
 
        public function get icon():String {
        	return _icon;
        }
 
        public function set icon(anIcon:String):void {        
        	_icon=anIcon;
        }
 
 
        public function get id():int {
            return _id;
        }
 
        public function set id(pId:int):void {
            _id = pId;
        }
 
 
        public function get category():String {
            return _category;
        }
 
        public function set category(pCategory:String):void {
            _category = pCategory;
 
            if ((_category == null) || (_category == "")) {               
                _category = "Default Category";
            }
        }
 
        public function get name():String {
            return _productName;
        }
 
        public function set name(pName:String):void {
            _productName = pName;
 
            if ((_productName == null) || (_productName == "")) {
                _productName = "default product name";
                category = _productName;
 
            }
        }
 
	}
}
xalibeut est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/04/2011, 14h55   #2
Membre éclairé
 
Inscription : janvier 2004
Messages : 319
Détails du profil
Informations personnelles :
Localisation : France, Paris (Île de France)

Informations forums :
Inscription : janvier 2004
Messages : 319
Points : 384
Points : 384
Essaie une premiere chose, utiliser le Metatag [Embed] pour tes images...
mais pas sur que tu y gagne beaucoup...

vu ce que tu dis, c'est une appli avec un backend java que tu utilise non?
Kantizbak est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 05h43.


 
 
 
 
Partenaires

Hébergement Web