Flex4 spark list which shows the number

sponsored links
Displaying the row number or index in a spark List
http://flexponential.com/2010/02/08/displaying-the-row-number-or-index-in-a-spark-list/
Flex4 spark list which shows the number

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" width="200" height="215"  viewSourceURL="srcview/index.html">
    
    <s:List height="200" width="200" top="10">
        <s:layout>
            <s:VerticalLayout gap="1" horizontalAlign="justify" />
        </s:layout>
        <s:dataProvider>
            <s:ArrayList>
                <fx:String>Roberto Luongo</fx:String>
                <fx:String>Scott Niedermayer</fx:String>
                <fx:String>Jarome Iginla</fx:String>
                <fx:String>Dan Boyle</fx:String>
                <fx:String>Rick Nash</fx:String>
                <fx:String>Ryan Getzlaf</fx:String>
                <fx:String>Martin Brodeur</fx:String>
                <fx:String>Chris Pronger</fx:String>
                <fx:String>Shane Doan</fx:String>
                <fx:String>Shea Weber</fx:String>
                <fx:String>Patrick Marleau</fx:String>
                <fx:String>Jay Bouwmeester</fx:String>
                <fx:String>Duncan Keith</fx:String>
                <fx:String>Dany Heatley</fx:String>
                <fx:String>Robyn Regehr</fx:String>
                <fx:String>Mike Richards</fx:String>
                <fx:String>Brenden Morrow</fx:String>
                <fx:String>Martin St. Louis</fx:String>
                <fx:String>Jeff Carter</fx:String>
                <fx:String>Eric Staal</fx:String>
                <fx:String>Sidney Crosby</fx:String>
            </s:ArrayList>
        </s:dataProvider>
        <s:itemRenderer>
            <fx:Component>
                <s:ItemRenderer>
                    <fx:Script>
                        <![CDATA[
                            import spark.components.List;
                            override public function set data(value:Object):void {
                                super.data = value;
                                
                                if (value == null)
                                    return;
                                
                                txtPlayer.text = String(data);
                                txtRowNumber.text = String(itemIndex);
                                
                                // NOTE: In older builds ItemRenderer.itemIndex didn't exist yet.  If you are on an older
                                // build you can get this information using the following line instead:
                                //
                                //txtRowNumber.text = String((owner as List).dataProvider.getItemIndex(data));
                            }
                        ]]>
                    </fx:Script>
                    <s:Group>
                        <s:Rect width="25" height="20">
                            <s:fill>
                                <s:SolidColor color="0xFF0000" />
                            </s:fill>
                        </s:Rect>
                        <s:Label color="white" fontWeight="bold" horizontalCenter="0" verticalCenter="0" />
                    </s:Group>
                    
                    <s:Label x="30" verticalCenter="0" />
                </s:ItemRenderer>
            </fx:Component>
        </s:itemRenderer>
    </s:List>
    
</s:Application>

  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Flex4 spark list which shows the number

  • Openfire Plugin Developer's Guide

    Introduction Openfire features plug-ins are enhanced. This document is a guide to developers to create plug-ins. The structure of a plug-in Plug-ins Plug-ins openfireHome stored in the directory. When deploying a plug-in jar or war file, it will automatic

  • EJB ant script to deploy template works

    <? xml version = "1.0" encoding = "UTF-8"?> <! - Name Project name basedir build.xml file directory -> <project name="HelloWorld" basedir="."> <! - Property variables -> <! - The sour ...

  • spring myfaces hibernate richfaces

    1.web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j

  • Spring + Hibernate to use Glassfish Database Connection Pool

    applicationContext.xml file content <? xml version = "1.0" encoding = "UTF-8"?> <beans xmlns = " http://www.springframework.org/schema/beans " xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " ...

  • Process migration from tomcat to websphere changes

    Process migration from tomcat to websphere changes Because customers use the web application server software used by different what tomcat5, tomcat6, websphere5.1, websphere6.1, weblogic8, and so on, and the software used inconsistent standards, ibm's

  • JAVA EE JSP_JNDI

    dsfdsa http://lindows.javaeye.com/admin/blogs/213348 Tomcat 6 with the connection pool data source configuration http://www.blogjava.net/ec2008/archive/2008/07/19/216063.html project: test Driver path: D: \ workspace \ test \ WebRoot \ WEB-INF \ lib ...

  • Hibernate.cfg.xml configuration file (including the primary key generation strategy Introduction)

    Hibernate.cfg.xml configuration file: <? xml version = "1.0" encoding = "utf-8"?> <! DOCTYPE hibernate-configuration PUBLIC "- / / Hibernate / Hibernate Configuration DTD / / EN" "hibernate-configuration-2.0.dtd

  • The EJB3 Persistence

    EJB3 persistence with Hibernate is very similar to the mechanism: Environment: Server: JBOSS5.0 Database: MySQL5.0 1. Set up a data source First of all, in jboss-5.0.0.GA \ server \ default \ deploy, the establishment of a database used to connect the dat

  • Servlet brief introduction

    Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to run thread Servlet API for Servlet provides the s ...

  • Spring2.0 + hibernate3.1 + log4j + mysql demo

    applicationContext.xml Non-attachment jar package, necessary friends can send an email to todd.liangt @ gmail.com

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries