Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Hello, I am wondering what might be going on with this DG Table as is compacting all entries (see attached pic). I set it up the DG so I can drag items from another table inside. The strange thing is when I empty it out (set the dgData of group "AnimalsDG" to empty) it works correctly. I did adjust the row template to the same height and still get misaligned entries. Thanks for any help.
This is my 2nd version of coding, the first I changed how it adds to the grid with same misaligned result.
on dragenter
## This forces the underlying OS to supply the correct CURSOR
set the dragaction to "copy"
end dragenter
on dragdrop
put the dragdata["text"] into tDraggedAnimal
set itemdelimiter to tab --do this so goes in datagrid
put item 1 of tDraggedAnimal into tVarAdded
##### Checks for Duplicate Drag ######
set itemdelimiter to comma --reset delim for below to work
put the dgData of group "AnimalsDG" into theDataA
put the dgIndexes of group "AnimalsDG" into theIndexes
repeat for each item theIndex in theIndexes
put theDataA[theIndex]["Test"] into tCurrGrid
if tVarAdded is tCurrGrid then
answer warning "Already added " & quote & tVarAdded & quote & " to list!"
exit to top
end if
end repeat
put tUnitAdded into theDataA["Test"]
dispatch "addData" to me with theDataA
dispatch "dragCompleted" to group "AnimalsDG" with true
end dragdrop
Thank you for replying. I actually adjusted the row height so that is not the issue. As far as font goes, do DataGrid Tables not allow to adjust the font. I was under the impression this could be done. I will try to upload script so can figure out. Thanks
What version of LC are you using?
In the shift to the new PI in LC 8 the text (and a few other panes) for the DG were "dropped"
In the current RC release LC8.1.3rc1 they have been reinstated.
Text panel of DG PI LC8.1.3rc1
Unfortunately these panels are currently missing from the LC9 DP releases.
perhaps DP5 will correct this.
Thanks james, I altered the view with code (example: set the dgProp["header height"] of group "dataGrid 1" to "22") actually, but maybe it is not sticking because of what you mentioned. I am running LC 8.1.2, so I will try other version to get it to stick, if not I will write the staff to see. Thanks
newpie wrote:Thank you for replying. I actually adjusted the row height so that is not the issue. As far as font goes, do DataGrid Tables not allow to adjust the font. I was under the impression this could be done. I will try to upload script so can figure out. Thanks
i can change the font by selecting the grid, click on the text button at the top, and change the size, pretty sure it is a better way to do that.
has to say that i have to relearn everything about datagrid, everytime i try it.
Hello, wanted to give you an update. I confirmed with support this was bug introduced in livecode 8, it was put in (Bug 19227) so I am sure it will get fixed. A workaround for now is to reset it by doing the following. Hope this helps.
newpie wrote: Thu Feb 09, 2017 3:14 pm
Hello, wanted to give you an update. I confirmed with support this was bug introduced in livecode 8, it was put in (Bug 19227) so I am sure it will get fixed. A workaround for now is to reset it by doing the following. Hope this helps.
on openCard
set the dgData of group "yourGroup" to empty
end openCard
Thanks
Although this is a very old thread.
It is still an issue.
This line saved me from rebuilding my stack, as once you have something strange, like double text line on a row, you wont get it out. not even by deleting the template and re-adding the DG. (OK in IDE, not OK on Android) but now it is.
I have to be precise: this line above worked only after removing the DG and the template and adding a new DG after saving/reloading the stack. Only replacing the DG for a new one was not enough.
if i'm correct it could not be reproduced.
SO probably i had a local problem in my stack.
I replaced the DG and templates, it was a lot of work, but ok now.