Data Grid issue after deleting rows
Posted: Fri Aug 11, 2017 3:18 pm
Hi all
Finally starting to get my head into how Livecode works.....but I'm having an issue now that has me quite stuck.
I have one DataGrid (DG1) where I list available equipment. When the user double clicks on a selected piece of equipment, it gets added to another DataGrid (DG2).
Eventually the Information in DG2 will be submitted to a MYSQL table. However, in the mean time, if a user accidently adds a piece of equipment from DG1 to DG2 they need to remove it from DG2. To remove the equipment from DG2, they double click the unwanted equipment. I am able to remove the unwanted equipment, but if I remove all equipment, the following error is generated every time I go to add equipment again. "An error has occurred in behaviour for the column template: Chunk: no such object"
If I close LC down and restart, everything works okay. I can replicate this every time. Please see ScriptError1.jpg for a screenshot of the script.
To delete the unwanted rows (Equipment) from DG2 I use the following code (found this in another post...), I want the user to double click the item rather than having to highlight, then click a "Delete" button :
on mouseDoubleDown
put the dgHilitedIndex of me into theIndex
DeleteIndex theIndex
end mouseDoubleDown
Thanks in advance.
Finally starting to get my head into how Livecode works.....but I'm having an issue now that has me quite stuck.
I have one DataGrid (DG1) where I list available equipment. When the user double clicks on a selected piece of equipment, it gets added to another DataGrid (DG2).
Eventually the Information in DG2 will be submitted to a MYSQL table. However, in the mean time, if a user accidently adds a piece of equipment from DG1 to DG2 they need to remove it from DG2. To remove the equipment from DG2, they double click the unwanted equipment. I am able to remove the unwanted equipment, but if I remove all equipment, the following error is generated every time I go to add equipment again. "An error has occurred in behaviour for the column template: Chunk: no such object"
If I close LC down and restart, everything works okay. I can replicate this every time. Please see ScriptError1.jpg for a screenshot of the script.
To delete the unwanted rows (Equipment) from DG2 I use the following code (found this in another post...), I want the user to double click the item rather than having to highlight, then click a "Delete" button :
on mouseDoubleDown
put the dgHilitedIndex of me into theIndex
DeleteIndex theIndex
end mouseDoubleDown
Thanks in advance.