datagrid behaviour script with fields works unexpected

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
UKMC
Posts: 50
Joined: Sun Jan 08, 2017 12:01 pm

datagrid behaviour script with fields works unexpected

Post by UKMC » Tue Feb 21, 2017 3:25 pm

Hi altogether,

I have a datagrid form with 10 fields in each row

Depending on contents of each dataset, I want to show just some of the fields.
So I would have expected, that one of the following approaches in a repeat with i = 1 to n construct works

get "show field " & quote & "Nr"& i & quote & " of me"
do it

get "set the visible of field "& quote &"Nr"& i & quote & " of me to true"

do it

But it doesn't :-(

It works with images, it works with graphics, but it does not work with fields...
As I have graphics and fields in overlay, I estimated that perhaps layers do not work correctly in datagrid - so I made all graphics non-opaque - no result

I hope there is one out there who can give me the right hint.
Thanks in advance

Best regards


Ulrich

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

Re: datagrid behaviour script with fields works unexpected

Post by Klaus » Tue Feb 21, 2017 4:01 pm

Hi Ulrich,

no need to DO things here:
...
show fld ("Nr" & i) of me
...
will do (sic! :D ).

For eventual layering issues, you set up the template group for your FORM,
so it is up to you to avoid these kind of problems.
Or do you have some more "layout" code in your handlers?

Please post your complete code of your "row template".


Best

Klaus

UKMC
Posts: 50
Joined: Sun Jan 08, 2017 12:01 pm

Re: datagrid behaviour script with fields works unexpected

Post by UKMC » Wed Feb 22, 2017 12:41 pm

Hi Klaus,

thanks for your answer.

While writing my next post to this thread and preparing an example for you I found the solution.

The problem was not, that the fields were not shown, they were.
But the standard text they contain in the row template was deleted while incarnation of the rows
So I had just to set again the correct value.

Now everything work perfect.

Thanks for your post, it got me to the right thought !!

Best regards


Ulrich

Post Reply