- This topic has 5 replies, 3 voices, and was last updated 11 years, 7 months ago by
support-octavio.
-
AuthorPosts
-
globalgraffitiMemberIm trying to Add a value to the existing height of a scrollbar window so that the content grows the window grows. I have a button that appends a <li> element and makes the list grow with each click.
so if my “Content Area Height” is 500px by default with each click i want it to grow +50px.
Issue im having is that the height gets reset every time i interact with the UI.
my code works from what i can see in firebug, but as soon as i interact with UI the height reverts back to the set value in the mobione studio propteries panel for “Content Area Height” 500px.
function clickme() { // Trying to auto update the height $('#m1-form-landing-screen3-panel4-scroller').height( $("#m1-form-landing-screen3-panel4-scroller").height() + 50 ); // or $('#m1-form-landing-screen3-panel4-scroller').css( "height", "+=50px" ); }
November 29, 2013 at 11:47 am #344891
Unknown AuthorParticipantvar panelHt = 150 + itemCnt * 44; $('#m1-page_name-panel1-scroller').attr('data-layout-content-height',panelHt);
-1tc
December 2, 2013 at 11:24 am #344945
globalgraffitiMemberI tried your method but it appears itemCnt is not defined in your example. Can you adjust your code to include how you are defining that variable.
If any support members can take a stab at it i would appreciate it.
Thanks
GGDecember 3, 2013 at 1:19 pm #344972
support-octavioMemberHi globalgraffiti,
Your requirement looks very similar to the one in this thread: http://www.genuitec.com/support-genuitec/viewtopic.php?p=13511#p13511
Please take a look at the updateListHeight function in the _custom.js file attached to the reply and let us know how it goes for you.
December 3, 2013 at 3:15 pm #344976
globalgraffitiMemberThe code worked great! – it works both ways for updating the height on a Panel, when the user adds / removes a <li> item from list.
FYI // phoneui.preprocessDOM(‘#MY-CONTAINER-DIV’); // THIS WAS CAUSING PROBLEMS SO I REMOVED IT AND AFTER I WAS GOOD TO GO.
function RefreshSummaryList() { // ORDER SUMMARY updateListHeight(); }; function updateListHeight() { console.log("updateListHeight", (new Date())); var $scroller = $('#m1-form-landing-screen3-panel5-scroller'); //Update panel's content height, set the ht value on the panel's // scroller <div> data-layout-content-height attribute. var liCount = $("li", $scroller).length; var panelHt = 100 + (liCount * 44); // alert(panelHt); // $('#m1-list-panel1-scroller').attr('data-layout-content-height', panelHt); $scroller.css("height", panelHt + "px"); $scroller[0].myScroll.refresh(); }
December 9, 2013 at 5:22 pm #345117
support-octavioMemberHi globalgraffiti,
Glad you get it working, closing thread.
-
AuthorPosts