Return to Snippet

Revision: 48322
at June 29, 2011 00:44 by mcorlan


Initial Code
package org.corlan.components {
	
	import flash.events.MouseEvent;
	import spark.components.IItemRenderer;
	import spark.components.List;
	
	public class SectionList extends List {
		
		/**
		 * The property name for data that are section title items
		 */ 
		private var _sectionField:String;
		
		public function set sectionField(value:String):void {
			_sectionField = value;
		}

		/**
		 * Disable selection for section title items 
		 */
		override protected function item_mouseDownHandler(event:MouseEvent):void {
			var data:Object;
			if (event.currentTarget is IItemRenderer)
				data = IItemRenderer(event.currentTarget).data;
			if (data && data[_sectionField])
				event.preventDefault();
			super.item_mouseDownHandler(event);
		}
		
	}
}

Initial URL
http://corlan.org/?p=2931

Initial Description

                                

Initial Title
Flex Mobile SectionList

Initial Tags
list, mobile, Flex

Initial Language
ActionScript 3