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.
Data Grid issue after deleting rows
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Data Grid issue after deleting rows
Update
tried the following with the same results
put the dgHilitedLines of group "dgSelectedEquip" into theLineNo
dispatch "deleteline" to group "dgSelectedEquip" with theLineNo
However one thing I did try was add the following code a "Close don't Save" button:
on mouseUp
set the dgData of group "dgSelectedEquip" to empty
close this stack
end mouseUp
this clears the DG of all rows and doesn't cause the error.
tried the following with the same results
put the dgHilitedLines of group "dgSelectedEquip" into theLineNo
dispatch "deleteline" to group "dgSelectedEquip" with theLineNo
However one thing I did try was add the following code a "Close don't Save" button:
on mouseUp
set the dgData of group "dgSelectedEquip" to empty
close this stack
end mouseUp
this clears the DG of all rows and doesn't cause the error.
Re: Data Grid issue after deleting rows
Hi mrk,
just made a quick test here with both of your scripts and it works as exspected, even when deleting the last row?
Best
Klaus
just made a quick test here with both of your scripts and it works as exspected, even when deleting the last row?
Best
Klaus
Re: Data Grid issue after deleting rows
Klaus
Thanks for the prompt response. I was worried that may have been a response
Well, it shows that the codes works.....I must have done something during my "testing/learning" of the features.
Well, practice makes perfect....I guess I'll start a new Stack and see what happens.
As a side thought, is either way better than the other?
Thanks for the prompt response. I was worried that may have been a response
Well, it shows that the codes works.....I must have done something during my "testing/learning" of the features.
Well, practice makes perfect....I guess I'll start a new Stack and see what happens.
As a side thought, is either way better than the other?
Re: Data Grid issue after deleting rows
Hi mrk,
Best
Klaus
nope! Since both do what they are exspected to do and there are really no speed issues here, use whatever you like better.mrk wrote:As a side thought, is either way better than the other?
Best
Klaus
Re: Data Grid issue after deleting rows
Thanks again. Think I may need to sleep on it now...its nearly tomorrow.