I'd like to somehow combine or rather use two handlers in data grid without interfering with each other.
One is in the Label in the Row Template and allows the user to tap on the particular record (text line) in the data grid and view that line in a separate card.
The code is:
on mouseUp
go cd "onelineview"
end mouseUp
The second is in for native scrolling and is in the card with data grid:
Code: Select all
on openCard
## native android scroller
local tScrollerRect, tContentRect
// Only create a scroller on a mobile device
if environment() is not "mobile" then exit openCard
// Set the area of the scroller
put the rect grp "DataGrid 1" into tScrollerRect
// Set the area of the content to be scrolled
put 0,0,(the DGformattedWidth of group "DataGrid 1"),(the DGformattedHeight of group "DataGrid 1") into tContentRect
// Create the scroller control
mobileControlCreate "scroller", "loremScroll"
put the result into sScrollerID
// Set the properties of the scroller
mobileControlSet "loremScroll", "rect", tScrollerRect
mobileControlSet "loremScroll", "contentRect", tContentRect
mobileControlSet "loremScroll", "visible", true
mobileControlSet "loremScroll", "scrollingEnabled", true
mobileControlSet "loremScroll", "vIndicator", true
mobileControlSet "loremScroll", "vscroll", 0
end openCard
on closeCard
// Delete the scroller
if environment() is not "mobile" then exit closeCard
mobileControlDelete sScrollerID
end closeCard
on scrollerDidScroll hOffset, vOffset
// When the user scrolls move the displayed content
set the DGvScroll of group "DataGrid 1" to vOffset
end scrollerDidScroll
Or are there another handlers that would make this combination work properly?
keram