Posted By

GunnarHKarlsson on 10/07/11


Tagged


Versions (?)

iconitemrenderer


 / Published in: MXML
 

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" >
  3. <s:List width="100%" height="100%">
  4. <s:itemRenderer>
  5. <fx:Component>
  6. <s:IconItemRenderer iconField="icon" labelFunction="myLabelFunction"
  7. messageFunction="myMessageFunction">
  8. <fx:Script>
  9. <![CDATA[
  10. public function myLabelFunction(item:Object):String{
  11. var fileName:String = item.fileName;
  12. var fileSize:Number = Number(item.fileSize)/1024;
  13. return fileName + ", " + fileSize + " (Kb)";
  14. }
  15. public function myMessageFunction(item:Object):String{
  16. return "Is hidden: " + item.isHidden;
  17. }
  18. ]]>
  19. </fx:Script>
  20. </s:IconItemRenderer>
  21. </fx:Component>
  22. </s:itemRenderer>
  23. </s:List>
  24. </s:View>

Report this snippet  

You need to login to post a comment.