Alpha Video Training
Results 1 to 18 of 18

Thread: List control jumping to the top of the page on select

  1. #1
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default List control jumping to the top of the page on select

    I've got numerous list controls and if there are a lot of records showing, clicking on one way down causes the list to jump back to the top.

    List control
    Have the height be more than the viewable browser.
    Have more records than can be viewable in the browser.
    As you scroll down to the end of the list, the top title bar disappears on the scroll.
    At that point, clicking on a list object causes the list to jump back to the top column title bar.

    Anyone experience this phenomenon?
    If a jing video would help, I can do that.

  2. #2
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default Re: List control jumping to the top of the page on select

    This happens on a web browser. Haven't tested on Mobile as it's a Browser app.

  3. #3
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,576

    Default Re: List control jumping to the top of the page on select

    I can duplicate it... but am curious why you'd have those List settings? Why set the height of a List control more than the browser window? I'd suggest something like this... and possibly tied it to a sizing event...

    Code:
    var scrnHeight = window.innerHeight;
    scrnHeight = scrnHeight - 60; //60 is an arbitrary #... taking care of stuff apart from the List
    scrnHeight = scrnHeight + 'px';
    var lObj = {dialog.Object}.getControl('LIST1');
    lObj.setListSize(scrnHeight);

  4. #4
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default Re: List control jumping to the top of the page on select

    I'm creating an embedded product list in a webpage. (thus, the question about embedding via Javascript or something other than an iFrame in another post). So instead of updating the static website, the products are updated dynamically from the back end of Proof Works. (same app we've been working on). I don't want the list to scroll so I have to make it higher than the possible data that is displayed. So it scrolls with the web page, not independently. Because then you get a weird scrolling pattern when you use the mouse "wheel" or trackpad to scroll.

    This is what I'm avoiding...
    The page scrolls until it hits the list, then the list scrolls until it hits the end of the list, then the page scrolls again. Don't want that. Want a nice smooth scroll. But clicking on a list item jumps it back up to the top.

  5. #5
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,576

    Default Re: List control jumping to the top of the page on select

    Unless Alpha can prevent this behaviour you'd have to take control of the List yourself a completely derail it's processing. The List "selection" process never fires so you don't know which row you're on.

    This code will stop the browser window from jumping... but it also stops the List from processing. Maybe you can use it as a start, at least. There are complicated ways of getting at the row you clicked on, but running this code, in effect, wrecks List processing. Doesn't jump, though. You can run this code from a button... or from onRenderComplete... just to test it.

    Code:
    $('{dialog.ComponentName}.V.R1.LIST1.CONTROL.CONTENT').addEventListener("click",function(e){
    	$e.stopPropagation(e);
    });

  6. #6
    Member aal_fareed's Avatar
    Real Name
    Ahmed Shahin
    Join Date
    May 2010
    Location
    Saudi Arabia - Jeddah
    Posts
    387

    Default Re: List control jumping to the top of the page on select

    You can save the current scroll amount and then set it later:

    var tempScrollTop = $(window).scrollTop();

    ..//Your code

    $(window).scrollTop(tempScrollTop);
    To live anywhere in the world today and be against equality because of race or color is like living in Alaska and being against snow.”

    - William Faulkner

  7. #7
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,576

    Default Re: List control jumping to the top of the page on select

    It's a jQuery solution... and interesting Ahmed. Did you try it?

  8. #8
    Member
    Real Name
    Tracie Oken
    Join Date
    Jan 2013
    Posts
    17

    Default Re: List control jumping to the top of the page on select

    Anyone have a solution to this? I have the same problem in our web lists. It makes the list controls pretty ineffective unless you are on a mobile device

    Tracie

  9. #9
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,576

    Default Re: List control jumping to the top of the page on select

    This handles some of it... but I haven't had to chance to re-visit it. Part of the problem is that, while in the List... scrolling, at some point the List will not need to scroll any more, but the Window will then start scrolling. All ok. But, if you start scrolling back up in the List, the Window doesn't move... and selecting a row in the List is now messed up again. You'll need to add a scroll event to the Window to start tracking... and then get that into the UX. So... what's below is just a partial solution.

    Using jQuery... put this in your UX onRenderComplete...

    Code:
    setTimeout(function(){
    	{dialog.Object}.__tempScrollTop = jQuery(window).scrollTop();
    },4000);
    You can play with the setTimeout... even try to do away with it.

    In the List control... onSelect...

    Code:
    jQuery(window).scrollTop({dialog.Object}.__tempScrollTop);
    In the List control... onScroll...

    Code:
    {dialog.Object}.__tempScrollTop = jQuery(window).scrollTop();

  10. #10
    Member
    Real Name
    Tracie Oken
    Join Date
    Jan 2013
    Posts
    17

    Default Re: List control jumping to the top of the page on select

    Thanks David! I'll give this a go

    Tracie

  11. #11
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default Re: List control jumping to the top of the page on select

    This is still haunting me. I switched one over to a Viewbox to display the list of items in a customer order. If that list is long and after scrolling down the page, if the first line item passes the top of the browser and then you click on any line item, the viewbox jumps back up to the top of the page. Pretty annoying.

    Yes, I can set the height to be a set pixel number, but I'd rather have it keep expanding when more order items are added, so you can see all the items as you scroll down the order and not have to have that box that scrolls like David said earlier.

    Is this doing this jumping to the top for a specific reason?

  12. #12
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default Re: List control jumping to the top of the page on select

    Here's a quick video on what's happening.

    https://www.screencast.com/t/s9djXpsgX4p

  13. #13
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default Re: List control jumping to the top of the page on select

    Solved.

    Add this to the Additional Settings on the List Control to stop the jumping to the top when clicking on a list control row:

    Code:
    {
        "captureFocus": false,
    }
    They're adding a checkbox to do this also in some future release.

  14. #14
    Member
    Real Name
    Tracie Oken
    Join Date
    Jan 2013
    Posts
    17

    Default Re: List control jumping to the top of the page on select

    Hi David,

    This didn't resolve the issue for me. Here is a quick video: https://www.screencast.com/t/uLNHhxXqjKb

    I have several lists on my component that is on the page. The only way I've been able to make this work is to make the container that the list control is in 1200px tall (or any defined size).

    Are there any other changes necessary?

    Thanks for your efforts! Tracie

  15. #15
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default Re: List control jumping to the top of the page on select

    Previously, that's what I would do is set the height of the list to avoid the jumping.

    Here's my Additional Settings box on the List Control. Is this what yours looks like? And it should work earlier versions, but what version are you running? I have the pre-release Build 4740.

    capturefocus.png

  16. #16
    Member
    Real Name
    Tracie Oken
    Join Date
    Jan 2013
    Posts
    17

    Default Re: List control jumping to the top of the page on select

    We are a bit behind on 3962 so the fix must not be backwards compatible.

    Tracie

  17. #17
    Member
    Real Name
    David Fricke
    Join Date
    Sep 2011
    Location
    Kenosha, WI
    Posts
    398

    Default Re: List control jumping to the top of the page on select

    Tracie,
    What is the theme you're using? Is that custom CSS?

  18. #18
    Member
    Real Name
    Tracie Oken
    Join Date
    Jan 2013
    Posts
    17

    Default Re: List control jumping to the top of the page on select

    Yes. We've built our own themes for our app.

Similar Threads

  1. Replies: 2
    Last Post: 10-05-2016, 12:33 AM
  2. Multi-Select List control
    By CampnJim in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 03-08-2016, 07:52 AM
  3. Page jumping to top on clicking list item
    By Adrian_ in forum Mobile & Browser Applications
    Replies: 3
    Last Post: 11-20-2014, 01:16 PM
  4. List Control Select All Records
    By BillWFG in forum Mobile & Browser Applications
    Replies: 6
    Last Post: 05-23-2014, 08:56 PM
  5. List control select current record
    By jmsilva in forum Mobile & Browser Applications
    Replies: 8
    Last Post: 05-15-2014, 09:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •