4 Replies Latest reply on Jul 12, 2011 9:46 AM by lirask8

    Spark List disable Scrolling

    ne_polle

      Hi

       

      I'm using a List and I disabled the scrollpolicy und allowed the hole drag/drop stuff.

       

      The visible rows are smaller than the existing ones.

       

      Problem when I try to drag/drop an list-item I could scroll through the hole content of the list.

       

      I want to disble the scrolling effect.

       

      How could I do this???

       

       

      thanks for any advive and regards

        • 1. Re: Spark List disable Scrolling
          Gregory Lafrance Level 6

          Perhaps set the dropEnabled property to false?

           

          If this post answers your question or helps, please mark it as such. Thanks!

          http://www.stardustsystems.com
          Adobe Flex Development and Support Services

          • 2. Re: Spark List disable Scrolling
            ne_polle Level 1

            hmm thats the point.

             

            I want to see a small view of the hole list and I also want to have the drag/drop/drag-move possibilities.

             

            I did a little bit workaround as I tried this with the mx:List component. I reseted the vertical scroll position to zero when the ScrollEvent.SCROLL was catched.

             

            the s:List component doesn't interact with the ScrollEvent.

             

            Any other advice???

            • 3. Re: Spark List disable Scrolling
              Shongrunden Adobe Employee

              I'm not sure if this is the best way of doing this, but what about detecting scroll position changes and preventing changes:

               

              <s:Application

                  xmlns:fx="http://ns.adobe.com/mxml/2009"

                  xmlns:s="library://ns.adobe.com/flex/spark"

                  creationComplete="init()">

               

                  <fx:Script>

                      <![CDATA[

                          import mx.events.PropertyChangeEvent;

                          import mx.managers.DragManager;

               

                          private var storedVSP:Number = 0;

               

                          private function init():void {

                              list2.dataGroup.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, handle);

                          }

               

                          private function handle(e:PropertyChangeEvent):void {

                              if (DragManager.isDragging && e.property == "verticalScrollPosition"){

                                  trace('verticalSrollPosition trying to go to', e.newValue, 'changing to', storedVSP);                   

                                  e.target.verticalScrollPosition = storedVSP;

                              }

                          }

               

                          private function storeCurrentScrollPosition():void {

                              storedVSP = list2.dataGroup.verticalScrollPosition;

                          }

               

                      ]]>

                  </fx:Script>

               

                  <s:layout>

                      <s:HorizontalLayout />

                  </s:layout>

               

                  <s:List id="list1" height="100" dragEnabled="true" mouseDown="storeCurrentScrollPosition()">

                      <s:dataProvider>

                          <s:ArrayList>

                              <fx:Array>

                                  [0,1,2,3,4,5,6,7,8,9]

                              </fx:Array>

                          </s:ArrayList>

                      </s:dataProvider>

                  </s:List>

               

                  <s:List id="list2" height="100" dropEnabled="true">

                      <s:dataProvider>

                          <s:ArrayList>

                              <fx:Array>

                                  [0,1,2,3,4,5,6,7,8,9]

                              </fx:Array>

                          </s:ArrayList>

                      </s:dataProvider>

                  </s:List>

               

              </s:Application>

              • 4. Re: Spark List disable Scrolling
                lirask8

                You can try: MyList.scroller.enabled = false;