Page 1 of 1

Update mysql from datagrid

Posted: Thu Feb 13, 2014 9:03 pm
by DavJans
If there is a guide on this or lesson that would be great.
If not, this is how my brain is trying to get at it and maybe someone can help me.

#1 does the openField and closeField handlers work in a datagrid?

#2 I know how to get data in in a specific row based on what column it is in, what I need now is the name of the column I'm editing
after that, If closeField works in a datagrid I can then use the information I have gotten to update the data in my MySql server.

Re: Update mysql from datagrid

Posted: Fri Feb 14, 2014 2:22 pm
by Klaus
Hi DavJans,

1. not really!

2. You need to "catch" the "CloseFieldEditor" message, that is sent to the datagrid,
when the user finished entering data.

Put something like this into the script of the datagrid group, NOT into the behavior if present!

Code: Select all

on CloseFieldEditor pFieldEditor

   ## Get NAME of currently edited COLUMN:
   put the dgColumn of the target into theColumnBeingEdited

   ## Get newly entered content:
   put the text of pFieldEditor into tNewText
   ## Now you can update your database with the help of these infos.

   ## MOST IMPORTANT!
   pass CloseFieldEditor
end CloseFieldEditor
Hope that helps!


Best

Klaus


CloseFieldEditor

Re: Update mysql from datagrid

Posted: Fri Feb 14, 2014 4:45 pm
by DavJans
As always, you guys are the best, works perfectly.
Cant thank you enough

Re: Update mysql from datagrid

Posted: Fri Feb 14, 2014 5:11 pm
by Klaus
Hi DavJans,
DavJans wrote:Cant thank you enough
well, we could at least talk about that! :D


Best

Klaus