1. #1
    Sencha User
    Join Date
    Oct 2007
    Posts
    585
    Vote Rating
    0
    bhomass is on a distinguished road

      0  

    Default BoxComponent Move or onPosition events during container scroll?

    BoxComponent Move or onPosition events during container scroll?


    I know about getting scroll event. I am wondering whether you can also get the component Move event due to scrolling? this way you can focus on a particular component and know when it repositioned during scrolling?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    The Move event only happens (by default, of course you can fire it elsewhere) when any BoxComponent has setPosition called on it with something other than Style.DEFAULT for both arguments.

    You can however listen to the dom event Events.OnScroll to find out when a container has been scrolled, and update position accordingly. Without understanding your full use case it is hard to make suggestions, but it seems likely that you'd add a listener for OnScroll to every parent of the target component that could possibly scroll. Note that you might wish to use Event.Scroll instead if those parents are ScrollContainers or some other subclass of that.

Thread Participants: 1