Data Grid with Native Scrolling

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
dcpbarrington
Posts: 87
Joined: Tue Nov 13, 2007 6:40 pm

Data Grid with Native Scrolling

Post by dcpbarrington » Mon Mar 02, 2015 11:02 pm

Forum,

I need to be able to scroll through data in a Data Grid using the Mobile Native Control Scroller.

I've been able to get the functionality working in the attached Stack, HOWEVER, I cannot get the scroller to go to the very bottom or far right of the DataGrid on Android.
If you look a the Data Grid Scroll bar it shows that there is more data, but the native scroller will not scroll there. If you tap on the DG scroll bar it will take you to the data, but the Native Scroller will not.

Here is my code in the ScrollerDidScroll handler:

Code: Select all

on scrollerDidScroll hOffset, vOffset
   if environment() is not "mobile" then exit scrollerDidScroll
   
   if scrollID is Empty OR scrollGroupID is Empty then
      logSaverError "Scrolled without valid Scroll definition:  " && scrollID && scrollGroupID
      exit scrollerDidScroll
   end if
   
   -- Set the DataGrid Scroll
   put vOffset + 0 into VertOffset  -- Size of the Header
   if VertOffset >= 0 then
      set the dgVScroll of scrollGroupID to VertOffset
   else
      set the dgVScroll of scrollGroupID to 0
   end if
   if hOffset >= 0 then
      set the dgHScroll of scrollGroupID to hOffset
   else
      set the dgHScroll of scrollGroupID to 0
   end if
   
end scrollerDidScroll
I tried to pad the vOffset value by the size of the DataGrid Header, but then you cannot get to the data that is at the top of the DataGrid.

Am I doing something wrong or is this a bug?
Attachments
DGNativeScroll.zip
Stack with DG with Native Scrolling
(11.54 KiB) Downloaded 65 times

dcpbarrington
Posts: 87
Joined: Tue Nov 13, 2007 6:40 pm

Re: Data Grid with Native Scrolling

Post by dcpbarrington » Mon Mar 16, 2015 7:12 pm

Haven't heard any response, so it looks like a bug to me.

Created Bug Report 14863 in Quality Center

http://quality.runrev.com/show_bug.cgi?id=14863

sphere
Posts: 662
Joined: Sat Sep 27, 2014 10:32 am
Location: the Netherlands

Re: Data Grid with Native Scrolling

Post by sphere » Fri Feb 23, 2018 8:14 pm

This bug was solved in lc9.0.0DP10.

But is present in LC8.1.9 stable, i've added a comment to the bug report.

I've had an DG with and one without images on Android. The one without images scrolls perfect, the one with images did not scroll and showed only 4 items (exactly fitting into the height of the DG) although there were 6 items when testing. In IDE everything showed but on device no. But dgLines answer 6, so 2 were no shown when scrolling. Test with LC900DP11 worked OK.
Hopefully they will fix it in LC8.1.10 too.
Please, stop quoting things my brother did not say. Thank you. Hans Zweistein.

Post Reply

Return to “Talking LiveCode”