facebook

Scrollpanel size

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #336866 Reply

    RossL321
    Member

    Hi
    I have been building a number of screens which require a scrollpanel to cope with the amount of data loaded into lists.

    I assumed that the scrollpanel content area height would be the property you needed to manipulate to ensure the user can scroll all the way to the foot of a list, but setting it at runtime doesn’t seem to alter the scrollable area height. It seems the design time setting gets adopted and cannot be altered on the client.

    Is there a workaround for this?

    thanks
    Ross

    #336871

    Brandon
    Member

    I believe after you set it you need to process the DOM again to get it to take, see if this works call it after you change the height:

    phoneui.preprocessDOM('name of screen to update UI');
    #336996

    RossL321
    Member

    Thanks CincyPlanet, but that did not work for me.
    I placed the code at the end of my documentReady logic, so it should have the new height of the scroller panel already set, but it didn’t work.
    This is my code for setting the scroller panel height:
    $(‘#m1-Main-panel1.scroller’).css({‘height’: + ht});
    Obviously I have calculated the new height based on the height of each list item I have added.
    Am I barking up the wrong tree?
    regards
    Ross

    #337003

    Brandon
    Member

    The first thing I see wrong is the syntax it should be a comma after height not :
    And you don’t need the {} in there.

    #337033

    RossL321
    Member

    Thanks for your help CincyPlanet.
    I had another syntax error in that simple expression, the ‘.’ instead of ‘-‘ before scroller!
    Unfortunately, still not working. Although the div for the scroller now takes the new height value programatically, and the preprocessDOM function is called, it seems that the scrolling still wont go down to show the additional content! As soon as you let the list go, it bounces back to show only those rows within the initial design time height setting.
    Any other ideas?

    #337038

    Yann
    Member

    Hello Ross
    have you updated your scroller?

    myscrollername.refresh();

    Yann

    #337358

    RossL321
    Member

    Hi Yann
    I am confused by your comment.
    I have tried refresh() on the DOM panel-scroller object, but there isn’t one, I tried JQuery, but I didn’t find one there either. Do you mean there is a refresh function in the phoneui?
    thanks

    #337368

    Yann
    Member

    Hi,
    if i understand, you have a div who’s populated and iscroll ‘height doesn’t refresh?
    if i can’t anticipate height of my content loaded by ajax i don’t use iscroll with panel object
    try to place an html object with inside

    
    <div id="wrapper">
        <div id="scroller"><ul id="mylist"></ul>
    </div>
    </div>

    and in your js file

    
    var data='<li>test</li>';
    var myScroll = new iScroll('wrapper');
    $('#mylist').append(data);    // an example but you can add content from ajax.
    myScroll .refresh();
    }

    hope this help you
    Yann

    #337427

    RossL321
    Member

    Thank you Yann. All better now. I wan’t aware that iScroll was the object I was using.
    Cheers
    Ross

    #337436

    Yann
    Member

    Hello Ross
    Glad to help you
    Yann

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Scrollpanel size

You must be logged in to post in the forum log in