Datagrid refresh

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
jkrische
Posts: 16
Joined: Mon Oct 06, 2008 5:45 pm

Datagrid refresh

Post by jkrische » Tue May 26, 2009 7:59 am

Hello all!

In the datagrid user guide PDF and the Lessons, it's noted that you should not attempt to refresh the grid from a control inside the grid. If my understanding is correct, this is because Rev is trying to delete the very control that is calling the refresh. Yes?

Ok, so... how does one get around this? In the solution I'm building, I absolutely have to be able to refresh the grid when the contents of a line change, when a new line is inserted or one is deleted.

A basic description of my grid is this:
it is an SQL-stored, datagrid-viewed event log of user-entered events on a given day (the user navigates which day to display elsewhere on the main stack). All lines have a timestamp field and various other fields about the event entry. Each line also displays the time interval between itself and the previous line. In the case of the first line, the interval is between that line and the last line of the previous day. This calculation is done by SQL and not by Rev. This interval calculation is "mission-critical" and thus MUST be accurate at all times. Each line contains a "deleteLine" button, may contain one of a variety of "postThisEdit" controls, but adding a record is handled outside the grid, and I can handle updating the grid for that process.

So, in the cases of deleteing or changing a line, the thread at:
http://forums.runrev.com/phpBB2/viewtopic.php?t=3056 might contain the answer but I wanted to be sure that was the right way to go before I go implementing anything.

Your help greatly appreciated...

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 979
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Post by trevordevore » Tue May 26, 2009 2:28 pm

The thread you reference has solutions you can use. If you are refreshing the data grid from a row behavior then you must use send in time.

If, however, you are processing all engine events in the data grid script then you don't have to worry since the data grid won't be deleted. I've updated the lesson that discusses this with two examples.


http://revolution.screenstepslive.com/s ... Suffering-
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

jkrische
Posts: 16
Joined: Mon Oct 06, 2008 5:45 pm

Many thanks

Post by jkrische » Tue May 26, 2009 3:40 pm

Thanks a ton, Trevor!

When I finish this solution and start selling it to the public, you'll be happy to know it will contain documentation made with my favorite documenting tool, your wonderful ScreenSteps. :)

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 979
Joined: Sat Apr 08, 2006 3:06 pm
Location: Overland Park, Kansas
Contact:

Post by trevordevore » Tue May 26, 2009 4:01 pm

Awesome. Definitely send me a link. I would love to see it.
Trevor DeVore
ScreenSteps - http://www.screensteps.com

Levure Application Framework: https://github.com/trevordevore/levure
LiveCode Resources for Developers: http://livecode.bluemangolearning.com

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”