Displaying the row number or index in a spark List

The ItemRenderer class in Flex 4 has an itemIndex property that was added after beta2. You can use this property within your item renderer to display the row number or index of an item in a spark List. The following example demonstrates a List with a custom item renderer that uses this itemIndex property. [...]

You Might Also Like...

  • Creating a fancy Spark List control item renderer in Flex 4

    376 readersThe following example shows how you can create a fancy Spark List control item renderer by setting the itemRenderer property. Full code after the jump. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/01/27/creating-a-fancy-spark-list-control-item-renderer-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" [...]

  • Setting a text indent on the Spark List control in Flex 4

    167 readersThe following example shows how you can set the text indent on a Spark List control in Flex 4 by creating a custom item renderer using the RichText control and setting the textIndent style. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/02/19/setting-a-text-indent-on-the-spark-list-control-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_textIndent_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" [...]

  • What is the Difference between a custom Component and an ItemRenderer?

    391 readersI've been working with D for a few months as a personal mentoring client. We chat either via e-mail or Skype and I help him with his personal growth as a programmer. He asked me this question recently on itemRenderers and custom Flex components which made me think, so I'm turning it into a post:

  • Preventing item selection in the Spark List control in Flex 4

    173 readersThe following example shows how you can prevent item selection in the Spark List control in Flex 4 by listening for the changing event and calling the preventDefault() method on the IndexChangeEvent event object instance. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/02/25/preventing-item-selection-in-the-spark-list-control-in-flex-4/ --> <s:Application name="Spark_List_changing_test" xmlns:fx="http://ns.adobe.com/mxml/2009" [...]

  • Resizing a Spark DropDownList control to match the currently selected item in Flex 4

    207 readersThe following example shows how you can resize the Spark DropDownList control to match the currently selected list item in Flex 4 by setting the DropDownList control’s typicalItem property to the currently selected item. Full code after the jump. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/01/21/resizing-a-spark-dropdownlist-control-to-match-the-currently-selected-item-in-flex-4/ --> <s:Application name="Spark_DropDownList_typicalItem_test" xmlns:fx="http://ns.adobe.com/mxml/2009" [...]

  • Creating a variable row height Spark DropDownList control in Flex 4

    243 readersIn a previous example, “Creating a variable row height item renderer on a ComboBox control in Flex”, we saw how you could create a variable row height item renderer on a Flex MX ComboBox control by setting the variableRowHeight property on the ComboBox control’s dropdown property. The following example shows how you can create a

  • Preventing the selected item highlighting in the Spark List control in Flex 4

    192 readersIn a previous example, “Preventing item selection in the Spark List control in Flex 4″, we saw how you can prevent item selection in the Spark List control in Flex 4 by listening for the changing event and calling the preventDefault() method on the IndexChangeEvent event object instance. The following example shows how you can

  • Looping through items in a Spark List control in Flex 4

    364 readersThe following example shows how you can loop through items in a Spark List control in Flex 4 by setting the Boolean arrowKeysWrapFocus property. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/02/03/looping-through-items-in-a-spark-list-control-in-flex-4/ --> <s:Application name="Spark_List_arrowKeysWrapFocus_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"> <s:controlBarContent> [...]

  • Styling Item Renderers in the DataGrid

    263 readersI've been blogging about different styling issues within the Flex framework. I'd like to take a second to touch on a fairly common issue when trying to style item renderers. Item renderers are extremely helpful with memory management. As a user scrolls through a list the the flash player only has to instantiate a handful

  • Creating a vertically auto resizing Spark TextArea control in Flex 4

    304 readersThe following example shows how you can create a Spark TextArea control in Flex 4 which resizes vertically when lines are added or removed by setting the heightInLines property to NaN (Not a Number). Full code after the jump. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/01/18/creating-a-vertically-auto-resizing-spark-textarea-control-in-flex-4/ --> <s:Application name="Spark_TextArea_heightInLines_NaN_test" xmlns:fx="http://ns.adobe.com/mxml/2009" [...]

'>Making Selections â The Quick Selection Tool â Photoshop Video Tutorial
  • SiteGrinder 3 Plug-in For Adobe Photoshop Adds eCommerce And Content Management To New Platform
  • Subscribe to RSS headline updates from: GurusUnleashed
    Powered by FeedBurner

  • Design & Career Resources

    Open design job and RFQ/RFP listings for Wednesday, 10 March Courtesy of Design Jobs Live!
    The latest resources and free stuff (like textures, fonts, Photoshop brushes, scripts, plug-ins, and much more!) from workflowFreelance.com. Read more!
    The latest headlines from workflowFreelance.com. Read more!
  • Popular Search Terms

    Curious what others are searching for? Below are the most popular search terms over the last 30 days.