Page 1 of 1

Row Template Column Behavior

Posted: Mon Mar 24, 2014 10:10 am
by nicoloose
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.

Re: Row Template Column Behavior

Posted: Mon Mar 24, 2014 1:25 pm
by Klaus
Hi Nico,

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


Best

Klaus

Re: Row Template Column Behavior

Posted: Wed Mar 26, 2014 7:28 am
by nicoloose
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

Re: Row Template Column Behavior

Posted: Wed Mar 26, 2014 12:53 pm
by Klaus
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

Re: Row Template Column Behavior

Posted: Wed Mar 26, 2014 2:02 pm
by nicoloose
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.

Re: Row Template Column Behavior

Posted: Wed Mar 26, 2014 2:13 pm
by Klaus
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" ...
...

Re: Row Template Column Behavior

Posted: Thu Mar 27, 2014 10:47 am
by nicoloose
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.