I'm having difficulty into trying to create a 'process' to delete a record. I've designed an app, where a card loads up and any edits for that card are done through a modal dialog. The dialog window continues to have a save and cancel button which either commits a change or not. My card contains a datagrid, and I have some code (below) which deletes a row of data in a datagrid.
Code: Select all
on MouseUp
local tSelectedRowList
put the dgHilitedIndexes of grp "myGrid" into tSelectedRowList
if (tSelectedRowList is not empty) then
answer "Really delete this line?" with "Delete" or "Cancel"
if (it is "Delete") then
send "DeleteIndex" && tSelectedRowList to grp "myGrid"
end if
end if
end MouseUp
Another thought I had was on the save button, I should delete all the lines corresponding to myGrid and then rewrite all the data in myGrid back to the db. This just sounds very inefficient way of doing it.
Anyone advise me any other ways I can record a deleted/hidden row and then pass on the relevant key(s) of the deleted record(s) on the save button to the delete sql query.
Many thanks
Jalz