Database to DataGrid to Display FAST!

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
cenglish
Posts: 34
Joined: Wed May 11, 2011 6:44 pm

Database to DataGrid to Display FAST!

Post by cenglish » Fri Feb 21, 2014 6:14 am

I am trying to grab a group of data from a local sqlite database and insert that data into a datagrid directly. The main objective here is speed. I'm willing to limit my calls to 50, if not 25 rows at a time. However, I'm also displaying thumbnails in this datagrid as well. I found a way to get this done by using this lesson:

http://lessons.runrev.com/s/lessons/m/d ... ts-of-data

However, I just realized that there's no way to get the data associated with each row from doing this. Atleast that's as far as I can understand about this method. The thumbnails are quite small, relatively 25kb per. But with cached controls turned on (for smooth scrolling), I cannot manage to get this data into my datagrid in under a second. If I turn of cache controls, 50 records takes less than half a second even with the thumbnails. However, once this data goes into the datagrid, I also need to be able to get the data associated within each row at any time. As with this lesson, I am not able to do so.

What I'm needing is a way to grab data from a sqlite local database, put that data into a datagrid with thumbnails (the thumbnails are not binary, they are urls but not being inserted as urls, "set filename of image to *http: link goes here*") all in under 2 seconds. It doesn't seem like a complex thing to do but I'm at the point of just going in circles now. Any feedback would be greatly appreciated. Thanks!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Database to DataGrid to Display FAST!

Post by Simon » Fri Feb 21, 2014 6:32 am

Hi cenglish,
Just a quick response.
"set filename of image to *http: link goes here*"
Isn't this the thing that is holding everything back? Fetching images from a server?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Database to DataGrid to Display FAST!

Post by MaxV » Fri Feb 21, 2014 1:40 pm

This may inspire you: http://livecodeshare.runrev.com/stack/7 ... administer

Then modify ConvertSQLCursorToArray in card "Data" script, in order to show image.

Otherwise you could:
  • retrive your data
  • ceate a card from zero
  • insert all the elements, text and images
  • put the clickable text to "prev 50 / next 50". This delete the card and create a new one.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply