Page 1 of 1
Executing code after editing of one cell in datagrid is done
Posted: Wed Jun 20, 2012 8:27 pm
by vladoportos
Hello All,
I have small application that I learn the LiveCode on and I'm stuck on one thing for now.
I want to execute function after a datagrid cell is edited ( automatic so there doesnt have to be save button to press ) that would update SQLitle DB with data from datagrid..
I have the part where it determine the line selected, break to array and extract values, but I was looking through the custom Column Behavior but I can't find proper handle
there is
on FillInData pData but this doesn't work so far :-/
Any idea how to approach this ?
Thanks,
Vladimir
Re: Executing code after editing of one cell in datagrid is
Posted: Thu Jun 21, 2012 4:28 am
by dunbarx
Hi.
I am not sure what you really are asking, but does this help? (from the dg manual, p228)
EditValue
- EditValue pKey - The EditValue message is sent to a table column control when EditCell or EditCellOfIndex is called. In this scenario there is no pKey parameter since the key is the column associated with the column control the message was sent to. Tip: use the dgColumn property of a column template to get the name of a column in the column control.
The EditValue message is sent to a row when EditKey or EditKeyOfIndex is called. In this case the first parameter is the name of the key in dgData that should be edited. Normally you will call EditFieldText from within the EditValue message in order to open a field editor for changing the contents.
Re: Executing code after editing of one cell in datagrid is
Posted: Thu Jun 21, 2012 10:06 am
by vladoportos
Thats not exactly what I need as EditValue pKey is called before editing as far as I understand.
What I want to do is have some action called after the editing is done.
What I want to achieve is automatic update of SQLite which is reflection of data in datagrid, so when user edit one cell and add some information in to, right after he is done editing code will execute that will store the new info in DB.
Something like onFinishEdit but I can't find were are all the calls are for custom row behavior...
Re: Executing code after editing of one cell in datagrid is
Posted: Thu Jun 21, 2012 10:27 am
by Klaus
Hi Vladimir,
check the "DataGrid" docs (PDF) for "CloseFieldEditor", that's the message you want to trap.
Get the PDF here:
http://lessons.runrev.com/m/datagrid
Best
Klaus
Re: Executing code after editing of one cell in datagrid is
Posted: Thu Jun 21, 2012 10:34 am
by vladoportos
Ahhh exactly what I was looking for !, many thanks