1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Answers
    2
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Red face Answered: event when the component show up in the screen

    Answered: event when the component show up in the screen


    Hello all
    I wonder if there is an event when the component show up in the screen.
    I mean, not the moment when the component is made, but the moment when the component start to appear the screen so that user can see the component.

    For example, I made a long list. and I add the button after the list.
    and I read through the list until the button show up!
    then the event occurs because button show up in the screen!

    is there such kind of event?
    If there is not, is there suggestion to how to make it?

  2. as you said, it is not easy job to make in this way.
    but it is closer!!
    do you think is there a way to check the component within the bounds of the screen?

    really,
    I keep thinking about it, and I got an idea that the last few components of the list have
    the scrolling event... but it feels not right for me.
    and I also thought about using carousel, and tried, but
    the carousel goes the other card even I didn't scroll the list fully yet.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    The painted event should fire when a component is drawn on the screen (even if it is hidden) like in a card layout.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Answers
    2
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Default Yeah that is true

    Yeah that is true


    Yeah I found the event show and painted, but that is fired when the component is drawn on the virtual screen. even if users can not see it, it is fired.
    the event I want to use is the event fired when the component is actually show up in the real computer screen.
    can you see the difference?

    for example, like the picture below.
    untitled.jpg


    it's on the same panel but, the event is fired when user really see the button 'more...'.

    Any idea?

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    There is no event when an element or component comes into view, There is a scrollend event on an element that you may be able to listen to.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Answers
    93
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Yeah, there is no easy way to do this if it is inside a scrolling container. You will need to listen to the scroller events as Mitchell suggested and check when the item is actually within the bounds of the screen.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  7. #6
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Answers
    2
    Vote Rating
    1
    jwjiwon is on a distinguished road

      0  

    Default Thank you all :)

    Thank you all :)


    as you said, it is not easy job to make in this way.
    but it is closer!!
    do you think is there a way to check the component within the bounds of the screen?

    really,
    I keep thinking about it, and I got an idea that the last few components of the list have
    the scrolling event... but it feels not right for me.
    and I also thought about using carousel, and tried, but
    the carousel goes the other card even I didn't scroll the list fully yet.

Thread Participants: 2