Datagrid blessing or nightmare

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

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

Datagrid blessing or nightmare

Post by sphere » Thu Jul 26, 2018 12:25 pm

Well that's maybe a bit rough said, because it let's us do things unbelievable.
But it can be very frustrating too.
One thing not to do is copy a DG to another stack or even in it's own stack.
Better is to start every time with a new DG even if more are needed in one stack and (re)create the (row)template needed for it.
or else....i found that copying a dg to another stack and even to another card that it does not do what you've expected.
The exact same script to fill the DG does simply not work, although it did before. Deleting one of the grids and adding a new one again, recreating the row-template and again the same script added suddenly does work.
Really frustrating and searching for the unfindable needle in the haystack.

Refreshing the DG did not help.
dispatch "ResetList" to group "DataGridName" did not help.
With strange things in LC i also tend to rename the preferences file so LC will create a fresh one, but also that did not help.
So as advise start every DG from scratch, do not copy. You can copy scripts from a textfile or so.
Last edited by sphere on Thu Jul 26, 2018 2:16 pm, edited 1 time in total.
2018 Worldwide Mobile Market share: Android 84.4% !!!, iOs 15.1%, others 0.1%

mrcoollion
Posts: 343
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: Datagrid blessing or nightmare

Post by mrcoollion » Thu Jul 26, 2018 1:33 pm

I think Data-grid's is great and I use then a lot, but I do agree that one should build it up from scratch and not copy.

bogs
Posts: 2384
Joined: Sat Feb 25, 2017 10:45 pm

Re: Datagrid blessing or nightmare

Post by bogs » Thu Jul 26, 2018 3:50 pm

And I am apparently in between you two, I almost never use them because, compared to other languages I've used the equivalent to a dg in, they either require a lot of setup or almost none at all (but you can't then access all their features).

When I do use them, I tend to use them strictly for the simplest end of what they can do, and since that is the case, I generally wind up far more using fields, which behave exactly as I expect them too.

Long wind up short, I can see why they are there, but almost never using them myself makes their importance to me less (probably than it should be).
Image

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 643
Joined: Fri Jun 27, 2008 9:00 pm

Re: Datagrid blessing or nightmare

Post by Mikey » Thu Jul 26, 2018 3:54 pm

dg's use template substacks and other behaviors that cause VBT. I think you can set them to act like backgrounds, though, and add the background to other cards in the same stack.
Now that Trevor is going hard-core YML, maybe we'll get DG 2.1 that you just configure in YML and can easily use between stacks.

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

Re: Datagrid blessing or nightmare

Post by sphere » Thu Jul 26, 2018 10:09 pm

bogs wrote:
Thu Jul 26, 2018 3:50 pm
And I am apparently in between you two,
Don't get me wrong, i've never said or was giving the intention that i disliked them. I really like them!! :D
Except i found that copying them is giving a bad headache, that you can't find the cause of not doing what it does normally, until you renew it completely with the exact same scripts.
2018 Worldwide Mobile Market share: Android 84.4% !!!, iOs 15.1%, others 0.1%

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

Re: Datagrid blessing or nightmare

Post by sphere » Thu Jul 26, 2018 10:11 pm

Mikey wrote:
Thu Jul 26, 2018 3:54 pm
VBT.
Please explain what you mean with VBT, thanks.
2018 Worldwide Mobile Market share: Android 84.4% !!!, iOs 15.1%, others 0.1%

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 643
Joined: Fri Jun 27, 2008 9:00 pm

Re: Datagrid blessing or nightmare

Post by Mikey » Thu Jul 26, 2018 10:16 pm

mucho baddo thanger

bogs
Posts: 2384
Joined: Sat Feb 25, 2017 10:45 pm

Re: Datagrid blessing or nightmare

Post by bogs » Fri Jul 27, 2018 10:34 am

sphere wrote:
Thu Jul 26, 2018 10:09 pm
bogs wrote:
Thu Jul 26, 2018 3:50 pm
And I am apparently in between you two,
Don't get me wrong, i've never said or was giving the intention that i disliked them. I really like them!! :D
I didn't say you did, I said my feeling about them falls in between yours and mrcoollion's, although I probably put my opinion in the wrong part of the line up, and maybe should have said it falls below yours and mrcoollion's, or that I have less of an opinion about them.

I think they are a blessing *if* you just need a simple grid that is instantly (but wrongly [no setup of the template]) usable with moving / resizeable columns that looks good {but of course, you could also use Bern's ModTableField, or roll your own version as well}.

I think setting them up to make use of their potential is a nightmare and very confusing even to long term users of the language (which I am not, only being a 1 year old as it were) as compared (like I said) to similar controls in previous languages I've written in, such as Delphi, basic(s), etc. where setup and use of the control is more obvious and only very slightly harder than setting up a table field.

I think that the control itself is a wonder of code in a way, as I've looked through it, but is just more complication than I myself need or want to use, and while I wouldn't call them a 'nightmare', they sure aren't all sweet dreams even to learn about, never mind get full use of.

As I said, I can see why they are there, but they sure aren't my "go to" grid for doing almost anything.
Image

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

Re: Datagrid blessing or nightmare

Post by sphere » Fri Jul 27, 2018 11:00 am

i'd be interested in Bern's ModTableField, where can i get it? :)

edit ***found it ! *** wel...thought i found it but the link i found is not working anymore, and there is something else from Bernd in the samplestacks, but i'm not sure if that is the same thing.

Anyone a link or zip?
Last edited by sphere on Fri Jul 27, 2018 4:13 pm, edited 1 time in total.
2018 Worldwide Mobile Market share: Android 84.4% !!!, iOs 15.1%, others 0.1%

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 643
Joined: Fri Jun 27, 2008 9:00 pm

Re: Datagrid blessing or nightmare

Post by Mikey » Fri Jul 27, 2018 1:47 pm

I've been messing with MTF on mobile but ran into some issues with it. Bernd is aware. I don't know if he can fix them or not.

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

Re: Datagrid blessing or nightmare

Post by jacque » Fri Jul 27, 2018 7:00 pm

As I said, I can see why they are there, but they sure aren't my "go to" grid for doing almost anything.
Datagrids were designed to hold large amounts of data that would otherwise be difficult or impossible for a normal field to manage. This is usually large result sets returned from a database. Their main attraction is the ability to dynamically load and scroll data as needed when a field isn't practical. Since I almost never need to do this, I don't use them much because a field is easier to maintain.

There is a perception that datagrids are intended for any data that needs columns and rows, and new users often choose them first when a field would do just as well. They are a workable choice for some types of form datagrids, though I usually find it easier to use duplicated template groups.

However, those who work with large databases swear by datagrids.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 2384
Joined: Sat Feb 25, 2017 10:45 pm

Re: Datagrid blessing or nightmare

Post by bogs » Fri Jul 27, 2018 8:30 pm

Absolutely Jacque, luckily for me, the largest dataset I have to handle is still well below 10k records, and unlikely to ever get above that (in my lifetime).
jacque wrote:
Fri Jul 27, 2018 7:00 pm
However, those who work with large databases swear by datagrids.
Are you sure you meant "by" and not "at" Image

:mrgreen:
Image

bogs
Posts: 2384
Joined: Sat Feb 25, 2017 10:45 pm

Re: Datagrid blessing or nightmare

Post by bogs » Fri Jul 27, 2018 8:38 pm

sphere wrote:
Fri Jul 27, 2018 11:00 am
i'd be interested in Bern's ModTableField, where can i get it? :)

edit ***found it ! *** wel...thought i found it but the link i found is not working anymore, and there is something else from Bernd in the samplestacks, but i'm not sure if that is the same thing.

Anyone a link or zip?
I hope Bernd will let me know if he doesn't want me to share this publicly, but for now, I've sent you a pm with a link to it.
Image

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

Re: Datagrid blessing or nightmare

Post by jacque » Fri Jul 27, 2018 8:40 pm

bogs wrote:
Fri Jul 27, 2018 8:30 pm
Are you sure you meant "by" and not "at"
Well, maybe both. :)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 643
Joined: Fri Jun 27, 2008 9:00 pm

Re: Datagrid blessing or nightmare

Post by Mikey » Fri Jul 27, 2018 8:59 pm


Post Reply

Return to “Bug Triage”