DataGrid2 - What do you like, what don't you like

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4663
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: DataGrid2 - What do you like, what don't you like

Post by jacque » Mon Sep 03, 2018 11:03 pm

I just noticed that if you scroll quickly and the content glides a little after you lift your finger, there is no scrollerEndDrag message. If you scroll deliberately and lift your finger without flicking, then the message is sent.

So it is possible to miss the end of a drag if the user flicks the scroller quickly. In any case, scrollerBeginDrag seems to always be sent reliably.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sphere
Posts: 702
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Tue Sep 04, 2018 7:20 am

Thanks qualcreek, i can give that a try with an test stack.

I hope my stack is not corrupted in any way. As Jacque's test stack works ok with the scrolling field.
What i also notice is, i fetch data from an external DB.
Then on mobile(Android) the DG shows only the rows which fit in the DG, then i switch to another card, then back to the card with the DG, and then it is able to scroll and shows the rest of the rows. In either way it shows me the correct tLinecounter value (via answer).
In IDE it works as expected, it shows all rows directly when scrolling. So that makes it harder to discover where the fault might be.
:D :o :) :shock: 8) :lol:

sphere
Posts: 702
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Tue Sep 04, 2018 6:22 pm

@Jacque

I even see a bunch scrollerDidScroll and a scrollerEndScroll without a scrollerbeginscroll.
Depends indeed on how you move/place/touch it
:D :o :) :shock: 8) :lol:

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4663
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: DataGrid2 - What do you like, what don't you like

Post by jacque » Tue Sep 04, 2018 7:47 pm

The behavior you describe happens to me when the initial scroll of the field and the native scroller don't match. Usually I set the scroll of the field to 0 before creating the scroller, which I think you do already. But if the scroll of the field is different on launch then a mismatch could happen. That's all I can think of.

I haven't used a scroller with a datagrid though, so I can't say for sure.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sphere
Posts: 702
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Tue Sep 04, 2018 7:50 pm

I've changed Jacque's teststack and replaced the fld"lorem" for DG2 grp"lorem"
Uncommented everything what had to do with creating the scroller

Then set the scrolbars to auto as Qualcreek mentioned. Used the Form. And added lines of text.
It scrolls but terrible slow and stuttering, and not comparable with the smoothness of the scroller you normally create.

Then i noticed, only scrollerDidScroll comes in the field below and not begin or end.
So how can you write something which will handle that?

I attached the stack so can see for yourself.
Thanks!
DGscrollerTest.zip
:D :o :) :shock: 8) :lol:

quailcreek
Posts: 726
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: DataGrid2 - What do you like, what don't you like

Post by quailcreek » Wed Sep 05, 2018 9:53 pm

Sphere,
When you populate the DG, I'm assuming in a PreOpenCard, add this after.
Again, sTheDataGridName is the name of your DG.

The very sluggish scowling with the native scroller has been added to the bug list. Hopefully it will be addressed soon.

Code: Select all

send "RefreshList" to grp sTheDataGridName
Tom
MacBook Pro OS Mojave 10.14

sphere
Posts: 702
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Thu Sep 06, 2018 12:14 pm

Thanks Jacque and Qualcreek,

i had it all in opencard handler, so changed that to preOpenCard, which is much nicer, as it looks ready right away.

i used ResetList but that is for something else according the dictionary.
So i tried RefreshList like qualcreek said, but which does not seem to do the trick.
The different DG's do show me the nr of rows via an answer command, but only still show me the rows which fit in the DG.
Funny thing is i can see the scroll bar going up and down in the reverse direction of the movement of my finger and by that you can see about how long the grid is (the more rows, the shorter the scrollbar).

Also i stepped back to a DG 8.1.10 version stack(saved lastly on LC8.1.10, never on LC9.x.x).
And i fixed in the test part from Jacque, so i get scollerdidscroll:andthenameofthescroller so thats good, but still not begin or enddrag.

I checked if it was a not LC9.x.x DG, and i can only recoqnize it as only the DG2 has Enable Swipe in the dgProps.
Still not clear about the difference in IDE and mobile.
:D :o :) :shock: 8) :lol:

sphere
Posts: 702
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth

Re: DataGrid2 - What do you like, what don't you like

Post by sphere » Thu Sep 13, 2018 6:24 pm

Just to inform, the bug request has now become an enhancement request for the DG2 https://quality.livecode.com/show_bug.cgi?id=21555
:D :o :) :shock: 8) :lol:

Post Reply

Return to “Talking LiveCode”