
Datagrids on mobile have built in native scrollers. They get created automatically when you go to a card with a datagrid on it, and they are destroyed automatically when you leave the card. Very helpful. Unfortunately, they also have a few annoyances. For instance, if you disable a datagrid, then the datagrid dutifully stops accepting any touch input - it stops scrolling and you can't click on anything. You can, however, still swipe down and the vertical indicator will dutifully move down as if the datagrid was scrolling. And, in fact, the datagrid is scrolling; the dgvscroll of the datagrid is changing, but the display is not updating so you don't see it. But as soon as you enable the datagrid and touch it, it will "jump" to where ever you scrolled. Needless-to-say this is not the desired behavior and can be very disconcerting. And unfortunately there is no "dgProp[]" property which will remove this behavior.
Fortunately, datagrid scrollers are "normal" mobile scrollers created with "mobileControlCreate" and therefore you can use the regular "mobileControlSet" routines on them. You just need to know the mobile scroller's name, which is always the "long ID" of the datagrid. So I have the following code in the group script of my datagrids:
Code: Select all
on disableMe
disable me
if the environment is "mobile" then
local tLongID
put the long ID of me into tLongID
mobileControlSet tLongID, "scrollingEnabled", false
mobileControlSet tLongID, "vIndicator", false
end if
end disableMe
on enableMe
enable me
if the environment is "mobile" then
local tLongID
put the long ID of me into tLongID
mobileControlSet tLongID, "scrollingEnabled", true
mobileControlSet tLongID, "vIndicator", true
end if
end enableMe
Code: Select all
disable grp "datagridName"
Code: Select all
send "disableMe" to grp "datagridName"
Code: Select all
send "enableMe" to grp "datagridName"