Page 1 of 1
Datagrid - strange behavior
Posted: Fri Apr 08, 2016 2:05 pm
by Simon Knight
Hi,
I have just started to use Livecode (7.1.3) after break and am refreshing my knowledge (ha!) on the working of Datagrids. I have created a simple stack that imports a list of names and addressed and I am displaying this list in two datagrids on the same card.
I have no specific problem of the “how do you do this” type but more a general observation. I have noticed that from time to time during editing a datagrid will just stop working. For example at present I am experimenting with a datagrid form and decided that I needed to edit the code in the LayoutControl as the default code referred to a field that had had its name changed. I commented out all the lines except
Code: Select all
set the rect of graphic "Background" of me to pControlRect
When I refreshed the datagrid it stopped displaying any data and worse un-commenting the lines made no difference. I suspect, but can not prove, that the engine had lost the connection to the behavior button and that the code was not being called. The display of the data was only restored by quitting Livecode and restarting.
This is not the first time that I believe I have seen what I have dubbed a silent failure when using datagrids and/or behavior buttons and wonder if anyone else has seen similar and has a work around.
Re: Datagrid - strange behavior
Posted: Fri Apr 08, 2016 11:27 pm
by quailcreek
Hi,
I work with DGs all the time and I have not seen this.
Re: Datagrid - strange behavior
Posted: Fri Apr 08, 2016 11:34 pm
by Simon
I wonder if just testing this in liveCode 8 would be of help.
At least on Win 7 I get a debug.log file on my desktop, easy to look into to see what went wrong.
I'm not sure if the log file covers things like controls... but maybe?
Simon
Re: Datagrid - strange behavior
Posted: Sat Apr 09, 2016 12:13 am
by Simon Knight
Thanks for your comments. I have LC 8 DP16 and will look for a log file. Quailcreek your set up is the same as mine, when you say you use Dgs often are you customising them with additional controls and editing/adding behavior buttons?
I think that I shall have to investigate further but I am wondering if my machine either has a fault or if the multiple migrations from earlier OS and different hardware has retained some extension that causes problems.
best wishes
Simon
Re: Datagrid - strange behavior
Posted: Sat Apr 09, 2016 12:49 am
by quailcreek
Simon,
Yes I have some heavily modified DGs. Setting the behavior btn on DG tables to an alternate btn so I can change the way it functions. DG forms too.
Re: Datagrid - strange behavior
Posted: Sat Apr 09, 2016 9:08 am
by SparkOut
Sometimes strange things happen if you have the row template open for editing while also making edits in the main stack structure that affects the datagrid. Make sure you save and close the row template before working on the datagrid itself.
Re: Datagrid - strange behavior
Posted: Sat Apr 09, 2016 4:00 pm
by Simon Knight
Hi again,
I have discovered a repeatable method of putting a datagrid into a state where modifying the code in the row behavior button fails to restore correct operation. In summary if the line exit to top is used things break. However, if the line is removed the datagrid remains broken until Livecode is restarted (on my machine).
I have managed to attach the stack file to this post and I have written some instructions which may be downloaded via this drop box link:
https://dl.dropboxusercontent.com/u/419 ... Readme.zip
I would be interested in knowing if the failure I see happens on other machines.
Thanks in advance.
best wishes
Simon K.
Re: Datagrid - strange behavior
Posted: Fri Feb 24, 2017 11:20 pm
by makeshyft
Thank you for this, I've been with DGs for a long time and they work perfectly, except I am juts now getting really inconsistent behavior.
Thank you for the efforts of trying to trace the issues, it seems like the same stuff I'm dealing with.
Have you been able to resolve anything here?
Re: Datagrid - strange behavior
Posted: Sat Feb 25, 2017 9:26 am
by Ledigimate
Hi Simon
I've also dealt with custom datagrids that seemed to break for no apparent reason, and eventually found that in my case it was caused by one really important line of code which was missing from my saveStackRequest handler.
If you handle the saveStackRequest message in a stack with a datagrid, then be sure to pass on the saveStackRequest message. Not doing so is guaranteed to break your datagrid!
Code: Select all
on saveStackRequest
-- do stack cleanup here
-- Do NOT omit the next line of code from a stack with a datagrid:
pass saveStackRequest
end saveStackRequest