flex - Smooth scrolling a Spark List with variable height items using the mouse wheel -


we have list of variable height items display in spark list control. when user clicks , drags vertical scrollbar list scrolls smoothly. when up/down arrows used moves in small , discrete steps. when mouse wheel used list scrolls in large discrete steps problematic user.

we enable smooth scrolling mouse wheel. height of our items vary , easy lost when scroll moouse due discrete scrolling.

our implementation simple:

<s:list id="chartlist"          dataprovider="{pm.charts}"         itemrenderer="charts.chartitemrenderer"         horizontalscrollpolicy="off"         verticalscrollpolicy="on"         usevirtuallayout="false"         cachepolicy="auto"> </s:list>  <?xml version="1.0" encoding="utf-8"?> <s:itemrenderer xmlns:fx="http://ns.adobe.com/mxml/2009"                  xmlns:s="library://ns.adobe.com/flex/spark"                  xmlns:mx="library://ns.adobe.com/flex/mx"                  autodrawbackground="false"                  xmlns:charts="charts.*"                 >     <fx:script>         <![cdata[             private var _canvas:bitmapdata;              public function set canvas(value:bitmapdata):void             {                 _canvas = value;             }              [bindable]             public function canvas():bitmapdata             {                 return _canvas;             }              public function render(x:int,y:int, data:int):void             {                 _canvas.draw(this);             }         ]]>     </fx:script>         <charts:defaultchartcontainer              chart="{data}"              cachepolicy="on"/> </s:itemrenderer> 

there not appear out of box method implementing smooth scrolling in spark list. how 1 go implementing smooth scrolling in spark list variable height items?

edit:

here way this: http://forums.adobe.com/message/3844410#3844410

ok, wont easy, doable.

1) create custom skin list

2) in custom skin, replace scroller custom scroller (myscroller)

3) create new class extends scroller, called myscroller

4) adobe in infinite wisdom made skin_mousewheelhandler private - seem on place, have override higher up, maybe attachskin , detachskin. or try adding own skin_mousewheelhandler higher priority in attachskin , prevent default on default not called.

5) replicate code in skin_mousewheelhandler, , modify suit requirements.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -