I've added a data grid to my app with a native scroller (using code from one of the other forum help posts).
The scrolling function works absolutely perfectly. The only problem is that I'm unable to select anything from the grid UNTIL I've scrolled first.
The data grid is checking for the scrollerDidScroll and not for the on mouseUp event. How can I get it to check for both events so that the user can either scroll down the list or simply select the first item they want to open?
Thanks in advance.
Code: Select all
on openCard
create_scroller
end openCard
on mouseUp
//Do something//
end mouseUp
on closecard
   delete_scroller
end closecard
command create_scroller   
   put "DataGrid1" into tScrollerGroup
   
   if the environment <> "mobile" then
      exit create_scroller
   end if
   
   // Create native scroller object and save its ID in a local variable
   MobileControlCreate "scroller", DataGrid1
   put the result into sScrollerId
   
   // RECT is the area on the card where the SCOLLER should do its work
   MobileControlSet sScrollerId, "rect", (the rect of grp tScrollerGroup)
   
   put the width of grp tScrollerGroup into tWidth
   put the dgFormattedheight of grp tScrollerGroup into tHeight
   set the dgvScroll of grp tScrollerGroup to 0
   // WHAT part fo the datagrid shall be scrolled-> the complete datagrid
   MobileControlSet sScrollerId, "contentRect", (0,0,tWidth,tHeight)
   
   // Display SCROLLER
   MobileControlSet sScrollerId, "visible", "true"
   
   // the typical BUMP effect when you ge to the edge of the object
   mobileControlSet sScrollerId, "canBounce", "true"
   mobileControlSet sScrollerId, "pagingEnabled", "false"
   mobileControlSet sScrollerId, "canScrollToTop", "true"
   mobileControlSet sScrollerId, "delayTouches", "true"
   mobileControlSet sScrollerId, "canCancelTouches", "false"
end create_scroller
// Will be sent when the user actually SCROLLs with his finger
on scrollerDidScroll OffsetX, OffsetY
   lock screen
   set the dgvScroll of group "DataGrid1" to OffsetY
unlock screen
end scrollerDidScroll
// REMOVE natove object when card closes!!!!!
command delete_scroller
   if the environment <> "mobile" then
          exit delete_scroller
   end if
     MobileControlDelete sScrollerId   
end delete_scroller
