ciao a tutti..ho un datagrid con dati caricati da file xml...il tutto usa la classe IconCellRenderer.as....io vorrei solamente rendere link i miei testi così da poterlo far funzionare da tabella links...cosa devo fare?
codice datagrid:
codice:
// Simple application with datagrid and icon
// by PhilFlash - http://philflash.inway.fr
import mx.controls.gridclasses.DataGridColumn;
// --- IconFunction ---
// Icon must be symbol with a linkage identifier
// Returns the linkage identifier (string)
contactIconFunction = function (itemObj:Object, columnName:String) {
if (itemObj == undefined || columnName == undefined) {
return;
}
switch (columnName) {
case "country":
var country = itemObj.country;
return (country == undefined ? undefined : "flag_"+country);
break;
}
}
// --- ---
contact_grd.columnNames = [ "name", "country"];
//customize columns
var col:mx.controls.gridclasses.DataGridColumn;
col = contact_grd.getColumnAt(0);
col.width = 250;
col.headerText = "Name:";
col = contact_grd.getColumnAt(1);
col.width = 100;
col.headerText = "Country:";
col.cellRenderer = "IconCellRenderer";
col["iconFunction"] = contactIconFunction;
contact_grd.setStyle("alternatingRowColors", Array(0xFFFFFF, 0xF7F7F7));
contact_con.trigger();
questo è l'xml:
<elenco>
<item numero="1" data="0" />
<item numero="2" data="0" />
<item numero="3" data="0" />
</elenco>
il tutorial l'ho scaricato da qui
http://philflash.inway.fr/dgrenderer/dgiconrd.html
grazie ciaociao