Datagrid smooth scrolling...

Hi Alex/ All,
       That  was great job. You have implemented smooth scrolling for List..  Based  upon that I have implemented the same in datagrid also..But I am facing  couple of issues...
    1.  I have Item renderer Text..  With in that text I am displaying almost 90 records and it has a huge  height. Accordingly the row height must change .. But what happend in my  case is the data is overlapped on the second row.. the row height  changes to certain height. after that it is not expanding.. records are  displaying and overlapped on the second row and if it still lengthy it  displayed on the third row also... so How can I solve this issue.. The  row height must vary with the itemrenderer..
2. Second  one is If I scroll vertically it is scrolling smoothly fine. But If I  release the mouse the scroller going to Row end position or row starting  position..
        I just want to fix the scroller position where user releases the Mouse from the vertical scrollbar...
      Can you please help me on this .. It is urgent  ..... I am posting my Datagrid code here...
package view.components.grid
    import flash.display.DisplayObject;
    import flash.events.Event;
    import mx.controls.Alert;
    import mx.controls.DataGrid;
    import mx.events.ScrollEvent;
    import mx.events.ScrollEventDetail;
    public class CustomGrid extends DataGrid
        private var fudge:Number;
        public function CustomGrid()
            super();
            offscreenExtraRowsOrColumns = 2;
        override protected function configureScrollBars():void
            super.configureScrollBars();
            if (verticalScrollBar)
                verticalScrollBar.lineScrollSize = .125;  // should be inverse power of 2
        override public function get verticalScrollPosition():Number
            //Alert.show("You are in vertical scroll Position handler");       
            if(!isNaN(fudge))
                var vsp:Number = super.verticalScrollPosition + fudge;
                fudge = NaN;
                return vsp;
            return Math.floor(super.verticalScrollPosition);
        override protected function scrollHandler(event:Event):void
            // going backward is trickier.  When you cross from, for instance 2.1 to 1.9, you need to convince
            // the superclass that it is going from 2 to 1 so the delta is -1 and not -.2.
            // we do this by adding a fudge factor to the first return from verticalScrollPosition
            // which is used by the superclass logic.
            var last:Number = super.verticalScrollPosition;
            var vsp:Number = verticalScrollBar.scrollPosition;
            if (vsp < last)
                if (last != Math.floor(last) || vsp != Math.floor(vsp))
                    if (Math.floor(vsp) < Math.floor(last))
                        fudge = Math.floor(last) - Math.floor(verticalScrollBar.scrollPosition);
                        trace(last.toFixed(2), vsp.toFixed(2), fudge);
            super.scrollHandler(event);
            var pos:Number = super.verticalScrollPosition;
            // if we get a THUMB_TRACK, then we need to calculate the position
            // because it gets rounded to an int by the ScrollThumb code, and
            // we want fractional values.
            if (event is ScrollEvent)
                var se:ScrollEvent = ScrollEvent(event);
                if (se.detail == ScrollEventDetail.THUMB_TRACK)
                    if (verticalScrollBar.numChildren == 4)
                        var downArrow:DisplayObject = verticalScrollBar.getChildAt(3);
                        var thumb:DisplayObject = verticalScrollBar.getChildAt(2);
                         pos = (thumb.y - downArrow.height) / (downArrow.y - thumb.height -  downArrow.height) * maxVerticalScrollPosition;
                        // round to nearest lineScrollSize;
                        pos /= verticalScrollBar.lineScrollSize;
                        pos = Math.round(pos);
                        pos *= verticalScrollBar.lineScrollSize;
                        //trace("faked", pos);
            var fraction:Number = pos - verticalScrollPosition;
            fraction *= rowHeight;
            //trace("was", listContent.y.toFixed(2));
            listContent.move(listContent.x, viewMetrics.top + listContent.topOffset - fraction);
            //trace("now", listContent.y.toFixed(2), fraction.toFixed(2), listItems[0][0].data.lastName);
Thanks
Ram

Renderers must report a correct measuredHeight based on a given
explicitWidth.  You may need to override measure() method.
If the rows are so tall they don't fully fit in the DG, there may not be a
simple solution for MX DataGrid The Spark DataGrid should be able to handle
it

Similar Messages

  • Datagrid smooth scrolling.. Don't want default row jump behaviour..

    Hi All,
          I am displaying large amount of data and each row contains itemrenderer Text. and this Text control displays large amount of data with in that... Whats the problem here is When we scroll vertically it goes jump into another row with showing total data.. I think this is a default property of datagrid. I just want avoid that and I need smooth scrolling of rows.. Can any one have any ideas about this.. any help can appriciable..
    Thanks
    Ram

    Hi Alex,
           That was great job. You have implemented smooth scrolling for List..  Based upon that I have implemented the same in datagrid also..But I am facing couple of issues...
        1.  I have Item renderer Text.. With in that text I am displaying almost 90 records and it has a huge height. Accordingly the row height must change .. But what happend in my case is the data is overlapped on the second row.. the row height changes to certain height. after that it is not expanding.. records are displaying and overlapped on the second row and if it still lengthy it displayed on the third row also... so How can I solve this issue.. The row height must vary with the itemrenderer..
    2. Second one is If I scroll vertically it is scrolling smoothly fine. But If I release the mouse the scroller going to Row end position or row starting position..
            I just want to fix the scroller position where user releases the Mouse from the vertical scrollbar...
          Can you please help me on this .. It is urgent  ..... I am posting my Datagrid code here...
    package view.components.grid
        import flash.display.DisplayObject;
        import flash.events.Event;
        import mx.controls.Alert;
        import mx.controls.DataGrid;
        import mx.events.ScrollEvent;
        import mx.events.ScrollEventDetail;
        public class CustomGrid extends DataGrid
            private var fudge:Number;
            public function CustomGrid()
                super();
                offscreenExtraRowsOrColumns = 2;
            override protected function configureScrollBars():void
                super.configureScrollBars();
                if (verticalScrollBar)
                    verticalScrollBar.lineScrollSize = .125;  // should be inverse power of 2
            override public function get verticalScrollPosition():Number
                //Alert.show("You are in vertical scroll Position handler");       
                if(!isNaN(fudge))
                    var vsp:Number = super.verticalScrollPosition + fudge;
                    fudge = NaN;
                    return vsp;
                return Math.floor(super.verticalScrollPosition);
            override protected function scrollHandler(event:Event):void
                // going backward is trickier.  When you cross from, for instance 2.1 to 1.9, you need to convince
                // the superclass that it is going from 2 to 1 so the delta is -1 and not -.2.
                // we do this by adding a fudge factor to the first return from verticalScrollPosition
                // which is used by the superclass logic.
                var last:Number = super.verticalScrollPosition;
                var vsp:Number = verticalScrollBar.scrollPosition;
                if (vsp < last)
                    if (last != Math.floor(last) || vsp != Math.floor(vsp))
                        if (Math.floor(vsp) < Math.floor(last))
                            fudge = Math.floor(last) - Math.floor(verticalScrollBar.scrollPosition);
                            trace(last.toFixed(2), vsp.toFixed(2), fudge);
                super.scrollHandler(event);
                var pos:Number = super.verticalScrollPosition;
                // if we get a THUMB_TRACK, then we need to calculate the position
                // because it gets rounded to an int by the ScrollThumb code, and
                // we want fractional values.
                if (event is ScrollEvent)
                    var se:ScrollEvent = ScrollEvent(event);
                    if (se.detail == ScrollEventDetail.THUMB_TRACK)
                        if (verticalScrollBar.numChildren == 4)
                            var downArrow:DisplayObject = verticalScrollBar.getChildAt(3);
                            var thumb:DisplayObject = verticalScrollBar.getChildAt(2);
                            pos = (thumb.y - downArrow.height) / (downArrow.y - thumb.height - downArrow.height) * maxVerticalScrollPosition;
                            // round to nearest lineScrollSize;
                            pos /= verticalScrollBar.lineScrollSize;
                            pos = Math.round(pos);
                            pos *= verticalScrollBar.lineScrollSize;
                            //trace("faked", pos);
                var fraction:Number = pos - verticalScrollPosition;
                fraction *= rowHeight;
                //trace("was", listContent.y.toFixed(2));
                listContent.move(listContent.x, viewMetrics.top + listContent.topOffset - fraction);
                //trace("now", listContent.y.toFixed(2), fraction.toFixed(2), listItems[0][0].data.lastName);

  • Smooth scrolling in mx:Datagrid

    Hi All,
    I am implementing a datagrid in my extension for Illustrator CS5, 6. I want to have smooth scrolling in it as there are images that are displayed in the grid. I am using an ItemRenderer for displaying images. It has one column. I searched the net and came across this blog by Alex Harui.
    This example is for List. I wanted it for datagrid. I overrode my datagrid scrollhandler and placed the code from the above example. Everything works fine except the up scroll. If I drag the scroll bar up/down, it works fine. If I scroll down by mouse clicks, it works fine. But, if I scroll up by mouse clicks, the scroll bar scrolls fine, but the grid view isn't updated. The grid view just repeats the images like in a loop. I am unable to understand.
    Can anyone guide me?
    Thanks!

    I changed the item renderer to just include label. But still no change, the up scroll is just not working. Can anyone guide me here? I am stuck.
    Thanks!

  • How can I get back the two button smooth scroll with Logitec optical marble mouse since Adobe Acrobat or FireFox updates on 10/26/2010 made it quit?

    Oct 25, 26 or 27 both Adobe Acrobat and Mozilla Firefox alerted me they had updates to install. Since I trust them both I installed them. However, since then my optical marble mouse from Logitech acted strangely different. The cursor did not move as usual. It didn't respond right. I thought it might have needed the dust wiped out, so I did that. It still acted sluggish when I tried to move it, it was as though it was "spinning its wheels" not going anywhere. I went to the Control Panel clicked on Mouse, and proceeded to look at the settings and set them to default. I then tried to use the universal scroll by clicking the two big buttons which showed a circle with cross hair arrows as usual. When the marble was moved forward or backward, the scroll had always been smooth allowing one to read the screen evenly and without holding any button down. Now it was jerky. Is this a problem from the last update? My version of Firefox is 3.6.12
    Thank you

    I am happy to see another person is having this jerky scroll situation with the latest update to Firefox on October 27. I did check my I.E browser and '''THAT BROWSER''' still does the nice smooth scroll....let's get 'er fixed Mozilla! I know you can!

  • How can I make the Smooth Scrolling option in the Advanced menu apply ONLY to the tab bar?

    So, I'm one of those people who usually have 60+ tabs open at any given time. I'm also on a Lenovo laptop with a trackpoint (that may be relevant later).
    Right now, I have smooth scrolling disabled.
    In previous versions of Firefox, if I sat my cursor on the tab bar and scrolled either up or down, it would scroll across my tab bar at a constant, quick rate, usually taking about two or three seconds to reach the end. This wasn't an animated scroll (I've disabled that animated scroll via about:config in the current Firefox version).
    However, now, it's doing something different. There's acceleration to the scroll. If I just tap the scroll in either direction, it scrolls only a few tabs. However, if I hold the scroll for a second, it instantaneously takes me to the far end of the tab bar, completely skipping at least thirty tabs in between.
    I have tab scroll buttons added by Tab Mix Plus (smooth scrolling is also not enabled in that addon), and the same accelerating behavior occurs there. One or two taps of the button moves the bar a few tabs to the left or right, but several taps in quick succession takes me all the way to the far end of the bar.
    I can restore the old scrolling behavior for the tab bar by turning on smooth scrolling in the Options > Advanced menu, but that turns on smooth scrolling for web pages at the same time. I don't like the web page smooth scrolling, and would rather not have it on.
    Or if there's any other way to make it so that scrolling the tab bar moves the tab bar a fixed amount no matter what, that would be great.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Smooth scrolling on a horizontal page - how did Benjamin Moore do it?

    Hi,
    I'm trying to work out how Benjamin Moore did this (in their COLOURSTORIES Canadian Version). We're looking to do something similar (Different content on the horizontal and vertical formats), but can't work out how Benjamin Moore managed to get a scrolling horizontal page.
    The screen shot is below:
    We're looking, if possible, to have the horizontal and vertical versions of each article smooth scrolling.
    Is this possible?
    Also, is there a static URL for the features & bug fixes for the most recent release? I'm finding that even searching the forum thows up "This is fixed in the new release" without any reference to what the release is (v21, v22 etc). T'would be a help!
    Cheers,
    Simon.

    Thanks Bob - my problem was not realising the "Scrolling direction" relates to the orientation of the orientation of the articles, and not as the name suggests the scrolling direction. Another fact stored in the noggin for future use

  • How to make smooth scroll in muse

    I want the smooth scroll effect in my site just like this http://nexgeninnovators.com

    You can try to use anchors on page and link them to fixed positions on page, that would create similar effect.
    But if you are looking for setting up jump scrolling on page then at current stage we cannot setup this with scroll effects.
    Thanks,
    Sanjit

  • How can I turn off smooth scrolling in Lion?

    I can't not turn off smooth scrolling.
    Actually, I don't want to use smooth scrolling in Lion OS.
    How can I turn off smooth scrolling in Lion?
    In case of Leopard, there is option on  "System Preferences, Appearance".
    Please help me.

    Apple > System Preferences > General > Use smooth scrolling: http://docs.info.apple.com/article.html?path=Mac/10.7/en/mchlp2472.html

  • Preview on iPad through Folio Overlays window of smooth scrolling article.

    Preview on iPad through Folio Overlays window of smooth scrolling article (ex. 1024 x 2000 px) is not working anymore. Article is scaled and turned in vertical orientation. No problem with Folio Builder.

    Thanks for reporting this, I'll pass it on to our test team for investigation and they'll log a bug against a future release if we can reproduce it.
    Neil

  • Scripting the lenght of a page (for smooth scrolling in DPS)

    Hi, folks
    I am quite a layman in this scripting world but I have a question that I would really need answered. It's not so much a question of 'how' but one of 'is this possible with scripting'?
    We want to set up a system where the pages would be automatically created with XML input from a short set of templates so that they end as indesign documents in a given folder.
    We have a very clear idea now on how to do that. But now, I have to take a design decission: Should I try using "one-page articles" with pages of variable lengt depending on the size of the body text frame? (so that they make afterwards smooth scrolling in Adobe DPS)?
    What refrains me from doing that is that body text will be variable in size and lenght. So... I cannot predetermine which length must have the main frame in the pages and, consequently, I cannot predetermine the lenght of the pages (expressed as top margin + body frame length + bottom margin).
    The question for scripting: Is it possible that you may run a script that does this?
    - Text is input into the main body text frame via XML import.
    - Frame is resized so that it fits with content (no more, no less).
    - Page is then resized so that (expressed as top margin + body frame length + bottom margin) it keeps designed proportions.
    I hope what I want is clear enough, because that is the doubt that is stopping me from trying the one long page winding way. Any idea, please?
    Thanks a lot
    Gustavo (Posting from Madrid)

    Hi Gustavo,
    yes you can accomplish what you are describing with InDesign scripting.
    Instead of creating a smooth scrolling page you could even create a frame with scrollable
    content on the template an fill the scrollable content with text.
    That way you will not have empty spots on the page.
    That sounds like an exiting project which combines InDesign, DPS and scripting skills.
    Stefan

  • Need help with smooth scrolling of a sprite

    Hi All,
    Something that i have had many problems over the years with
    is creating the same nice smooth scrolling effect that i see on
    many sites (my scrolling always appears jerky in AS2 even when done
    on a movieClip with a high framerate - with onEnterFrame updates).
    At the moment i am building my first AS3 site, and want to
    use it as an opportunity to "do things right".
    So far i have a very simple setup that is scrolling a sprite
    that contains a series of loaded images based on the position of a
    scrollbar. As one would expect from something this simple - it is
    rather jerky.
    I tried a number of variations of using a Tween to do the
    scroll, and kill/update that tween when the mouse moves again.
    However in all cases the results were not good (multiple tweens
    seemed to still be active - so killing the tween wasn't working).
    So clearly i am doing something wrong.
    I have searched extensively, but have not come across any
    examples that seem appropriate (some predefined components - but
    that does not help me understand the fundamentals) . I have seen
    some examples that register a timer, and manually calculate the
    offset for each frame, is this the correct approach?
    Below is my existing simple (jerky) implementation.
    All help to understand how to make this scrolling smooth
    would be hugely appreciated.
    One more thing to add incase it is relevant, is that the
    contents of the Sprite are a series of jpg images loaded with the
    Loader class (although i plan on switching to using the BulkLoader
    class created by a developer in the AS3 community).

    nope. the approach for the smoothest tween would be to:
    1. initialize your parameters
    2. create your timer.
    3. add your timer's listener method when needed (when your
    slider is clicked).
    4. in your timer's listener function repeatedly poll the
    slider's position and update your sprite using the parameters
    determined in 1.
    5. remove your listener when the slider is released.

  • I have not found any answers yet to solve this problem. Smooth Scroll Auditions CS5

    I used to used Audition 3 and when recording or playing back the recorded wave form would be smooth and when it reaches the right hand edge of the screen it just smoothly continues. I have updated to Auditions CS5 and I cannot get it to do the same. It seem to jump back to leave more room instead on continually scrolling. In the preference option there is no option I can see to change this. The only option shows Playback but this seen to also just jump back to leave more room.   Any idea where the setting it so make is smooth?   Thanks in advance

    Hello Ryclark..     The playback is the same as record.  Unlike AD3, when the waveform gets to the right had side of the time line it JUMPS back to make room for the continuing recording where the recording is longer than the width of the screen.  After an online chat with Adobe support ( who do not seem to know how their software works) , in the end they said that the new feature was for the Cursor and Waveform to Jump back to leave room for the continuation of the recording....unlike AD3 which smoothly scrolled the waveform.  It is a step backwards and looks like a novice attempt...  So if anyone wants to know if there is a solution to this backward step the Answer it NO. It is a new Jumpy flow layout.    Seems like Adobe are getting like Microsoft,,,

  • Smooth Scrolling

    What happened to the smooth scrolling feature on the new MBP's, My coreDuo Macbook has it, but I cannot find the option on my new pro. Is it not there?

    I'm in the process of setting up my new MBP 15", received yesterday. Smooth scrolling is not activated by default in 10.5.2. Visit System Preferences/Appearance...

  • Can you add smooth scrolling in the next update?

    It would be very, very, VERRRYY nice if they added Smooth Scrolling in an update of Safari.
    IE, Firefox and Chrome support it, and I think that actually, alot of people didn't notice or want this feature.
    So.. please add it, pretty please, because I and alot of others prefer Safari to other browsers...

    Apple is trying to slowly slice ties with Google so that is why they removed the YouTube app as well as made their own Maps app.
    Google has already made their own YouTube app that is on the App Store for free but right now it is only for iPhone, they will release a version for the iPad soon.

  • Horizontal Scrolling without Smooth Scrolling?

    Hello,
    I'm building an iPad presentation in InDesign using the DPS features. I'd like to make my presentation scroll through the pages horizontally, is this possible without activating smooth scrolling?

    Right I see, thankyou. This is one of my first iPad presentations made using the DPS features. I've still got to get my head around some of the tips and tricks.

Maybe you are looking for

  • How to move image in Java Awt.

    Hi , I am developing a simple application using Java awt. I have created a application which displays a image. now i want it to move automatically using a timer or something. How can i do it. if i have to change the x and y position of the image in w

  • Content problem in IE

    On my homepage: http://www.healthinsurancecolorado.net/ Everything below the link "group health insurance" isn't clickable in IE. When you move your cursor over any of the text, it doesn't change from arrow to cursor and won't allow you to click on a

  • JPA on 10.1.3 SOA servers

    Hi All, We wrote a JPA Entity Manager and Entity Factory using Top Link as entity manager and wrapped with web service for one of our application. 1) User invoke our web service, this web service internally invoke JPA to persistence data as mentioned

  • Method not found error even though method exists....

    hello i m a newbee to sun and oracle technologies these days i m doing teh SRDemo tutorial with JDeveloper (ADF) I m having a problem and cannot figure out its solution so far problem is i have a utility funtion defined in a AFDUTIL javaclass, when i

  • Notification if MA inside of PA

    Hello, I created notification using this great tutorial http://www.scsm.se/?p=948, all notifications are sent to Affected and AssignedTo users of parent Service Request, if Manual Activities are updated. But it doesn't work if Manual Activity is insi