That looks more extensive than the one from the lesson which i use normally.
I will give that a try and see if it will scroll smoother.
It's only around 2100 lines and 4 columns of simple text, that should be doable i think and not heavy to cope with?
i did not quite get this sentence:
I set sTheDataGridName to the name of the DG in the preOpenCard handler.
how exactly do i use the scrollerBeginDrag/scrollerendDrag and the other handlers when i have 3 DG's each on an own card. (because i think i need this: set the dgHilitedLine of grp sTheDataGridName to empty)
I don't think i can use it on each card? (because of the handler name)
If used on the stack i believe it's also not working. In the dictionary is written that it is send to the script which created the scroller.
of course i can put the name of the DG group into a global variable when the handler is inthe stack script , but i don't believe it works.
as still when i scroll it almost always mousesUP to the last row i touched.
i don't know if something like this can be used?
on scrollerBeginDrag pScrollerName
---edit---maybe i can use mousestilldown in the dg group and then set the dghilitedline to empty
on scrollerBeginDrag
local tScoller
put mobileControlTarget() into tScoller
if tScoller is "theDataGrid_1" then set the dgHilitedLine of grp "UpSellList_DG" to empty
-- if tScoller is "theDataGrid_2" then set the dgHilitedLine of grp "usedTricks_DG" to empty
end scrollerBeginDrag
on scrollerEndDrag
local tScoller
put mobileControlTarget() into tScoller
if tScoller is "theDataGrid_1" then set the dgHilitedLine of grp "UpSellList_DG" to empty
-- if tScoller is "theDataGrid_2" then set the dgHilitedLine of grp "usedTricks_DG" to empty
end scrollerEndDrag
According the dictionary, if you give a name to the scroller like: mobileControlCreate "scroller", "thenameofthescroller" then the mobilecontroltarget should return the name, if no name is given the id is returned.
But according to your example:
put mobileControlTarget() into tScoller , and then check
answer tScoller
gives a number, so the id of the created scroller, and not the name.
Therefore it does not work unfortunately.
and as i delete the created scroller when leaving the card, a new id nr will popup
Perhaps i can overcome this by not deleting the scroller and use if not exist then create a mobile controller, but i think i should return the name as written in the dictionary.
tomorrow i will check again or if you qualcreek or someone else can confirm, then if still the same result then i will create a bug report
I don't think Android recognizes the scrollerBeginDrag and scrollerEndDrag handlers. That's one of the reasons LC is having trouble getting the native scroller to work x-platform. I did the test on my Android and no-joy. Works fine on iOS.
So if you're using LC 9 rc 2, why aren't you using the native scroller?
According the dictionary it is for iOs as well as Android.
Except for some command you can set something for deceleration, which only is iOs.
Well i could not get the scroller to work(that is i see thing about swipe left and right, and only a setting for static/scroller), except for how it is working now.
I wrote a test stack and tried it in both Android 6.0.1 and 9.0. I get the correct messages and the target is the name of the scroller. I used a log field instead of the answer command to eliminate the possibility that the answer dialog was interfering.
If you are only using the scroller name, you don't need to store the ID in a script-local. I stored it anyway, just to replicate your original scripts, but it didn't matter if it was there or not. It isn't really being used except to delete the scroller on closecard, and you could use the name for that instead.
I'll enclose it here so you can try it.
EDIT: I wrote it in LC 9 so the stack may not open in earlier versions.
To get the native scroller to work set the Show vScrollbar/Show hScrollbar in the DG PI under the Data Grid tab to true or auto. But like I said, it still has some problems.