DataGrid MisAligned

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!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

DataGrid MisAligned

Post by newpie » Thu Feb 02, 2017 7:42 pm

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.

Code: Select all

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
Attachments
datagridTable.PNG
datagridTable.PNG (14.71 KiB) Viewed 6254 times

hpsh
Posts: 52
Joined: Tue Aug 25, 2015 8:06 pm

Re: DataGrid MisAligned

Post by hpsh » Sat Feb 04, 2017 11:38 pm

think it is one of 2 problems, either the font are to big, or you need larger row height.

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: DataGrid MisAligned

Post by newpie » Sun Feb 05, 2017 4:36 pm

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

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: DataGrid MisAligned

Post by jameshale » Mon Feb 06, 2017 3:07 am

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.
LiveCodeScreenSnapz002.jpg
Text panel of DG PI LC8.1.3rc1
Unfortunately these panels are currently missing from the LC9 DP releases.
perhaps DP5 will correct this.

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: DataGrid MisAligned

Post by newpie » Tue Feb 07, 2017 4:11 am

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

hpsh
Posts: 52
Joined: Tue Aug 25, 2015 8:06 pm

Re: DataGrid MisAligned

Post by hpsh » Thu Feb 09, 2017 11:23 am

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.

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: DataGrid MisAligned

Post by newpie » 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.

Code: Select all

on openCard
   set the dgData of group "yourGroup" to empty
end openCard
Thanks

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: DataGrid MisAligned

Post by sphere » Sun Jul 28, 2019 2:39 pm

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.

Code: Select all

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.

newpie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 155
Joined: Sat Jun 29, 2013 11:24 pm

Re: DataGrid MisAligned

Post by newpie » Tue Aug 20, 2019 8:18 pm

Thanks Sphere for post. Do you know if the bug is still active in the bug list?

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: DataGrid MisAligned

Post by sphere » Tue Aug 20, 2019 9:10 pm

Hi Newpie,

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.

You can check for errors and open/closed isssues here:https://quality.livecode.com/

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”