Row Template Column Behavior

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
nicoloose
Posts: 99
Joined: Mon Sep 16, 2013 3:35 pm

Row Template Column Behavior

Post by nicoloose » Mon Mar 24, 2014 10:10 am

Good day,

I have created a column in my datagrid which I use to click buttons for editing records, deleting records, etc. I have everything working nicely except the buttons only show on the second line for 12 lines, skips a line of buttons and then shows another 12 lines and so on all the way to the end of the records. See attached screenshot.

Any idea would be helpful thank you.
Attachments
Screen Shot 2014-03-24 at 11.09.38 AM.png
Screen Shot 2014-03-24 at 11.09.38 AM.png (33.33 KiB) Viewed 4936 times

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Row Template Column Behavior

Post by Klaus » Mon Mar 24, 2014 1:25 pm

Hi Nico,

please show us your script(s), especially the "fillInData" handler.


Best

Klaus

nicoloose
Posts: 99
Joined: Mon Sep 16, 2013 3:35 pm

Re: Row Template Column Behavior

Post by nicoloose » Wed Mar 26, 2014 7:28 am

Hi Klaus,

There is no script in fillInData section. pData variable is blank. I have created the buttons in the row template and placed my scripts in the buttons. What else can I send you that may shed some light?

Best
Nic

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Row Template Column Behavior

Post by Klaus » Wed Mar 26, 2014 12:53 pm

Hi Nic,

aha, OK, so you have a datagrid of type TABLE and you added some buttons to the row template***.
Then you "set the dgtext of grp xyz" to a tab delimited list, is that correct so far?

*** I am not sure if this is supported at all in a DG of type TABLE.


Best

Klaus

nicoloose
Posts: 99
Joined: Mon Sep 16, 2013 3:35 pm

Re: Row Template Column Behavior

Post by nicoloose » Wed Mar 26, 2014 2:02 pm

Hi Klaus,

Yes this is correct, I was also under the impression that buttons would not work in a table grid but all the buttons work as expected. Each button has it's own script as such:

Code: Select all

global gArray
on mouseUp
   get the dgHilitedIndex of control "salesGrid"
   put the dgDataOfIndex[it]of control "salesGrid" into gArray
   open stack "salesStack"
end mouseUp
When the salesStack opens, gArray is passed and everything works as expected. Just a bit bizarre that it would skip the first and every 12 lines.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Row Template Column Behavior

Post by Klaus » Wed Mar 26, 2014 2:13 pm

Hm, no idea what's going on there!?
So no 13th line, maybe LC is superstitious? :D

Hint: "control X" is valid syntax, but directly using the correct object type is even faster:
...
set the dgtext of GRP "salesGrid" ...
...

nicoloose
Posts: 99
Joined: Mon Sep 16, 2013 3:35 pm

Re: Row Template Column Behavior

Post by nicoloose » Thu Mar 27, 2014 10:47 am

Actually, it's no first line and then a break every twelve lines.. Livecode appears to be very superstitious!
Could it be that the grid is populated with data prior to the buttons being rendered? That still wouldn't explain why it would skip records.

Post Reply