I’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: What is the difference between a custom component and an item renderer? Are they or can they be the same thing?? In general terms, an itemRenderer is a custom component. But, not all custom components can be used as itemRenderers. An itemRenderer component should implement
498 readersThe 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. [...]
600 readersThe following example shows how you can create a custom item renderer in Flex 4 which repositions elements based on the current item renderer’s index in the data provider using the itemIndex property. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/04/08/creating-an-alternating-item-renderer-in-a-spark-list-control-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_itemIndex_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" [...]
529 readersThe following example shows how you can create a semi-transparent item renderer on a Spark List control in Flex 4 by creating a custom Spark List skin and a custom item renderer which sets the alpha property on the selected/hovered states. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/04/06/creating-a-semi-transparent-item-renderer-on-a-spark-list-control-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_alpha_test" xmlns:fx="http://ns.adobe.com/mxml/2009" [...]
970 readersThe following example shows how you can set a custom context menu on a Spark List control item renderer in Flex 4 by setting the contextMenu property in the item renderer’s dataChange event. <?xml version="1.0"?> <!-- http://blog.flexexamples.com/2010/05/06/setting-a-custom-context-menu-on-a-spark-list-control-item-renderer-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_contextMenu_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" [...]
521 readersThe following example shows how you can add a delete button to the hovered state of a Spark List control item renderer in Flex 4 by creating a custom item renderer and listening for the mouseDown event. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/04/09/adding-a-delete-button-in-the-hovered-state-of-a-spark-list-control-item-renderer-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_hovered_test" xmlns:fx="http://ns.adobe.com/mxml/2009" [...]
501 readersOne of the nice features of the Flex mx:List component is that you can set the renderers to be editable without having to create a new itemrenderer. With the Spark List (s:List) that option is no longer available. Fortunately it is quite easy to create a custom editable itemrenderer for the List. swfobject.embedSWF("http://www.dgrigg.com/samples/editable-list-itemrenderer/EditableList.swf", "flashContent", "500",
511 readersIn an earlier example, “Creating an alternating item renderer in a Spark List control in Flex 4″, we saw how you could create a custom item renderer in Flex 4 which repositions elements based on the current item renderer’s index in the data provider using the itemIndex property. The following example shows how you can
519 readersThe following example shows how you can create a custom item renderer with a corner radius on a Spark List control in Flex 4 by setting the cornerRadius property and creating a custom item renderer which sets its autoDrawBackground property to false and draws its own rounded background fill using the radiusX property in the
769 readersThe following example shows how you can remove the item highlight background on a Spark List control in Flex 4 by setting the itemRenderer property to a custom item renderer with the Boolean autoDrawBackground property set to false. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/04/22/removing-the-rollover-and-selection-highlight-on-a-spark-list-control-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_autoDrawBackground_test" xmlns:fx="http://ns.adobe.com/mxml/2009" [...]
699 readersThe following example shows how you can use a Spark RadioButton control as an item renderer for a Spark List control in Flex 4 by setting the itemRenderer property. <?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2010/05/20/creating-a-radio-button-item-renderer-on-a-spark-list-control-in-flex-4/ --> <s:Application name="Spark_List_itemRenderer_RadioButton_test" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" [...]
8,013
Subscribe to RSS headline updates from:
GurusUnleashed
Powered by FeedBurner
Curious what others are searching for? Below are the most popular search terms over the last 30 days.

