Page 3 of 6
Re: DataGrid2 - What do you like, what don't you like
Posted: Sun Apr 01, 2018 10:38 am
by sphere
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.
Thanks Quailcreek!
Regards, Sphere
Re: DataGrid2 - What do you like, what don't you like
Posted: Fri Aug 31, 2018 9:05 pm
by sphere
@qualcreek
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
Re: DataGrid2 - What do you like, what don't you like
Posted: Fri Aug 31, 2018 11:40 pm
by quailcreek
HI Sphere,
You'll need to create a scroller for each DG and of course name the scrollers differently.
Code: Select all
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
Re: DataGrid2 - What do you like, what don't you like
Posted: Sat Sep 01, 2018 1:26 pm
by sphere
Great!
yes i have a scroller for each DG.
Yes that seems very logic, i did not think about this solution.
Going to test it right away.
Thanks very much qualcreek for your help!
Best regards,
Sphere
Re: DataGrid2 - What do you like, what don't you like
Posted: Sat Sep 01, 2018 10:23 pm
by sphere
Maybe there is a bug. (tested on lc901rc2)
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
Re: DataGrid2 - What do you like, what don't you like
Posted: Sun Sep 02, 2018 12:00 pm
by sphere
Re: DataGrid2 - What do you like, what don't you like
Posted: Sun Sep 02, 2018 9:06 pm
by quailcreek
Hi Sphere,
I get the name of the scroller. I tested in LC 9 rc2 and LC 8.1.10
Re: DataGrid2 - What do you like, what don't you like
Posted: Sun Sep 02, 2018 9:26 pm
by sphere
Hi qualcreek,
on what phone or emulator did you get it?
Android or iPhone? And what version?
--edit-- i see i forgot to mention on what phone i'm missing it, it's on an Android 6.0 and also emulator Android 6.0.
Re: DataGrid2 - What do you like, what don't you like
Posted: Sun Sep 02, 2018 11:25 pm
by quailcreek
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?
Re: DataGrid2 - What do you like, what don't you like
Posted: Mon Sep 03, 2018 11:23 am
by sphere
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.
Re: DataGrid2 - What do you like, what don't you like
Posted: Mon Sep 03, 2018 6:19 pm
by jacque
I read your bug report. MobileControlTarget is a function so it needs parentheses. What do you get if you change it to: answer mobileControlTarget()?
Re: DataGrid2 - What do you like, what don't you like
Posted: Mon Sep 03, 2018 7:55 pm
by sphere
Also then it only gives the id of the created scroller, instead of the scroller name.
Re: DataGrid2 - What do you like, what don't you like
Posted: Mon Sep 03, 2018 9:37 pm
by jacque
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.
Re: DataGrid2 - What do you like, what don't you like
Posted: Mon Sep 03, 2018 9:52 pm
by sphere
Thanks very much Jacque, will test it and let you know tomorrow.
Yes the ID is indeed not needed, you're right.
--EDIT-- quick test, works OK with begin and end scroller.
ok loosing my mind here...
Re: DataGrid2 - What do you like, what don't you like
Posted: Mon Sep 03, 2018 10:01 pm
by quailcreek
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.