scroll - Livecode- scrolling a datagrid (with last offset) -
i have created scroller control datagrid following code:
function scroller_create tpoint local tscrollerrect, tcontentrect if environment() not "mobile" exit scroller_create put rect of group "list" tscrollerrect put 0,0,(the dgformattedwidth of group "list"),(the dgformattedheight of group "list") tcontentrect mobilecontrolcreate "scroller", "listscroll" put result sscrollerid mobilecontrolset "listscroll", "rect", tscrollerrect mobilecontrolset "listscroll", "contentrect", tcontentrect mobilecontrolset "listscroll", "visible", true mobilecontrolset "listscroll", "scrollingenabled", true mobilecontrolset "listscroll", "vindicator", true mobilecontrolset "listscroll", "vscroll", tpoint end scroller_create
when more data added datagrid, destroy , recreate scroller control. wanted make scroller stay on last vertical scroll offset (tpoint).
but mobilecontrolset "listscroll", "vscroll", tpoint still reset vertical scroller top when scroller recreated...
is there other way can fix vscroll of datagrid on last offset?
thanks in advance!
why don't change contenctrect? store vscroll in custom property using mobilecontrolget , set again.
Comments
Post a Comment