On investigation it appears the CloseFieldEditor is sent before the data is
updated into the table so I had to obtain the oldData to make my adjustments as
the new data affects a calculation to obtain the sum of the column.
See this script:
on CloseFieldEditor pFieldEditor
put the text of pFieldEditor into tNewValue
put the dgColumn of the target into tColumnName
put the dgHilitedLines of me into tLine
put the dgDataOfLine[tLine] of me into tData
put tData[tColumnName] into tOldValue
put tData["recID"] into tRecID
if tColumnName = "budget" then
put tNewValue - tOldValue into tChangedValue
add tChangedValue to fld "budget"
add tChangedValue to fld "remaining"
end if
saveCellDataToDB tRecID,tColumnName,tNewValue
end CloseFieldEditor
It is a shame that the DataGrid does not send a message when ALL the updating
of the DataGrid is complete?
All the best
Terry
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode