DataGrid and a native Scroller

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
yachris
Posts: 20
Joined: Sat May 21, 2011 1:26 am

DataGrid and a native Scroller

Post by yachris » Tue Jun 14, 2011 11:40 pm

Hello,

I've got a DataGrid with a lot of entries, and so of course I'd like to scroll it, using the native iOS scroller so it will look correct.

I've visited the two recent scroller discussion threads, and VERY much appreciate the comments of the people there.

And it *almost* works! The DataGrid scrolls, but only the lines visible initially are ever shown... I just see white below that. It's like the DataGrid isn't being redrawn properly.

I'll try to put together a simple example stack to show the problem, but I thought if someone knew the answer off-hand it'd be great to get an answer.

THANKS!

~~~~~~~~~~~~~

Edit: here's a stack that shows the behavior.
Attachments
DGNS.livecode.zip
(6.53 KiB) Downloaded 411 times

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: DataGrid and a native Scroller

Post by Jellicle » Sat Jun 18, 2011 9:38 am

Go back to my stack - the example one you got this code from. Note that my scroller consists of 2 objects - a group called "Text Scroller" and a field called "textfield". Your adaptation uses only one object - the datagrid group you are trying to scroll. You need both. Try replacing the "textfield" object in my example stack with your datagrid, and go from there :)
14" MacBook Pro
Former LiveCode developer.
Now recovering.

yachris
Posts: 20
Joined: Sat May 21, 2011 1:26 am

Re: DataGrid and a native Scroller

Post by yachris » Sat Jun 18, 2011 3:29 pm

Hi Jellicle,

Thanks very much for getting back to me on this... I really appreciate it!

I tried your suggestion... as near as I could... and no joy. Please see the attached stack, which is my stack changed as you suggest (I think!).

If I've done something wrong, please let me know. I've gone over both stacks pretty carefully, and as near as I can tell didn't miss any settings or properties that may help.

Thanks!
Attachments
DGNS2.livecode.zip
(6.78 KiB) Downloaded 393 times

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: DataGrid and a native Scroller

Post by Jellicle » Sun Jun 19, 2011 2:26 am

The attached stack is my original with your datagrid inserted into the group instead of my text field. I noticed that your datagrid was a form...not sure if that was your problem, but making it a table seems to work in my stack :) BTW my stack is Retina screen sized...
Attachments
Datagrid Scroller Example.livecode.zip
(12.7 KiB) Downloaded 441 times
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: DataGrid and a native Scroller

Post by Jellicle » Sun Jun 19, 2011 2:41 am

Whoops. I just clicked to the fact that you are wanting the grid to appear in a smaller rect on the card. That's do-able - you just need to adjust the rects you use. Can't do an example now (need to get out on my bike!) but have a go yourself :)
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: DataGrid and a native Scroller

Post by Jellicle » Sun Jun 19, 2011 3:11 am

Here you go...does this work for you?
Attachments
DataGridScrollerTest2.livecode.zip
(15.7 KiB) Downloaded 598 times
14" MacBook Pro
Former LiveCode developer.
Now recovering.

yachris
Posts: 20
Joined: Sat May 21, 2011 1:26 am

Re: DataGrid and a native Scroller

Post by yachris » Sun Jun 19, 2011 7:51 pm

Hey,

Thanks so much! That works fine. I don't know DataGrids well enough to know all the form/table implications, but I'll either make it work with the Table form, or switch to the "HTML in a native HTML page" trick mentioned elsewhere.

Actually, I think I'll dork around with it for a while, and if I can't get it to work with the Form mode, I'll submit it as a bug.

Again, thanks for helping... much appreciated!

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: DataGrid and a native Scroller

Post by Jellicle » Mon Jun 20, 2011 8:06 am

No problem :) If you are looking to use html, this stack may be of use. It uses iPhone-style css (found on the internet) and dynamically builds html code to display the latest 10 tweets from a couple of twitter accounts. Use at your own risk, your milage may vary, contents may have settled in transit etc etc. It's not perfect but may help you on your way.

Gerry
Attachments
htmlscroller.livecode.zip
(43.53 KiB) Downloaded 532 times
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Post Reply