Field Editor Updating dgData

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
ittarter
Posts: 151
Joined: Sat Jun 13, 2015 2:13 pm

Field Editor Updating dgData

Post by ittarter » Tue Jan 02, 2018 2:56 pm

Hello,

I have a datagrid form with an editable field. I've edited the handler "CloseFieldEditor" in order to save the edited data. However I also want to immediately/automatically save changes to the datagrid's dgData to my online database upon closing the field editor.

The problem is, dgData is not updated to reflect changes until AFTER the handler closefieldeditor finishes(according to my experience and according to the LC dictionary under the datagrid entry "EditFieldText"). So if I call my handler at the end of closefieldeditor, dgData does not yet reflect the changes made in the field editor.

I can bypass the problem in a messy way by using something like

Code: Select all

send "updateDB" to this card after 250 milliseconds
but I'm sure there's a better way to do this. Any ideas? For example, is there another "hidden" handler that actually updates dgData, where I could stick my "send" command, so that it happens after dgData is updated?

I'm using LC 8.1.6. Thanks in advance!

ittarter
Posts: 151
Joined: Sat Jun 13, 2015 2:13 pm

Re: Field Editor Updating dgData

Post by ittarter » Wed Jan 10, 2018 12:23 pm

Did I finally stump the forum? (bump)

montymay
Posts: 142
Joined: Thu Jul 18, 2013 5:23 am

Re: Field Editor Updating dgData

Post by montymay » Thu Jul 02, 2020 11:41 pm

Hello

I too have a similar problem. I have data grid rows that get their content from an online database. I have read but still fail to fully comprehend the instructions in the LC User Guide under the heading 'How Can the User Edit Content in a Data Grid Form'. A reading of the entries in the LC Dictionary for 'EditFieldText', 'EditValue', 'EditKeyofIndex', and 'CloseField Editor' also has not lead me to a solution to the problem of how my changes in the text of a field in a row will update the database.

As iitartar's question has received no response in more than two years, I hesitate to give further information but upon request can provide my script and further information. Thanks for any responses.

Monty

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7018
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Field Editor Updating dgData

Post by dunbarx » Fri Jul 03, 2020 12:50 am

DataGrids can be refreshed (updated) with:

Code: Select all

send "resetList" to group "yourDataGrid"
Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”