Page 1 of 1

Field Editor Updating dgData

Posted: Tue Jan 02, 2018 2:56 pm
by ittarter
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!

Re: Field Editor Updating dgData

Posted: Wed Jan 10, 2018 12:23 pm
by ittarter
Did I finally stump the forum? (bump)

Re: Field Editor Updating dgData

Posted: Thu Jul 02, 2020 11:41 pm
by montymay
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

Re: Field Editor Updating dgData

Posted: Fri Jul 03, 2020 12:50 am
by dunbarx
DataGrids can be refreshed (updated) with:

Code: Select all

send "resetList" to group "yourDataGrid"
Craig