Page 1 of 1

After selecting column visibility in DG table, code stops

Posted: Tue Dec 12, 2023 1:55 pm
by CAsba
Hi all,
I have a table dg "datagrid 3", with 33 columns and a few rows. The user selects a task and the code makes appropriate columns visible.

Code: Select all

set the dgProps["column visibility"] of group "datagrid 3" to  true,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false
   answer "xxx"
The code "answer "xxx"" represents the remainer of the code. 'xxx' does not show at runtime.
If I comment out the set the dgProps... ,false, the "xxx" shows (and the remainer of the code works).
Could there be some 'unfinished business' I have missed that makes the dg prevent further coding from being activated ?

Re: After selecting column visibility in DG table, code stops

Posted: Tue Dec 12, 2023 3:23 pm
by dunbarx
I guess you mean that
'xxx' does not show at runtime.
the rest of the handler runs normally?

There is nothing wrong that I can see with your code. In fact, I found that the dictionary has an error regarding the ability to individually set the visibility of certain columns as you did. It is a list of boolean items, not lines. The published API is correct, though.

Anyway, a handler addressing a test DG I made, albeit rather smaller, works fine. Code following the setProp line executes without issue.

Rewrite that line from scratch. Any problem with the text of even one of those parameters will cause that line to fail, and execution will stop.



Craig

Re: After selecting column visibility in DG table, code stops

Posted: Tue Dec 12, 2023 3:26 pm
by dunbarx
Nope.

I copied your actual line of code into my test stack and everything works fine.

Craig

Re: After selecting column visibility in DG table, code stops

Posted: Tue Dec 12, 2023 5:26 pm
by dunbarx
And are you sure you have the name of the DG right?

Craig

Re: After selecting column visibility in DG table, code stops

Posted: Tue Dec 12, 2023 6:27 pm
by CAsba
To be clear, I should have said

The code "answer "xxx"" represents the remainer of the code. 'xxx' does not show at runtime, AND NEITHER DOES THE REMAINER OF THE CODE.

Yes, the dg name is right, and the columns-visible configuration is made and is correct.

It's just that no code after the column visibility coding is working, not even something as simple as 'answer "xxx"'.

Re: After selecting column visibility in DG table, code stops

Posted: Tue Dec 12, 2023 6:44 pm
by dunbarx
Hi.

Make and name another DG. Put some data into it, perhaps from the inspector. It does not need to have as many columns as the original.

Try the same code for this new DG. Does it pass?

Craig

Re: After selecting column visibility in DG table, code stops

Posted: Tue Dec 12, 2023 6:47 pm
by dunbarx
CAsba.

I doubt that this is important, but
The code "answer "xxx"" represents the remainer of the code. 'xxx' does not show at runtime, AND NEITHER DOES THE REMAINER OF THE CODE.
Are we clear that all you ever meant was that execution stopped at the "set the DGProps..." line?

Craig

Re: After selecting column visibility in DG table, code stops

Posted: Wed Dec 13, 2023 2:21 pm
by CAsba
Hi Craig,
Yes.
I did a re-install of LC and now everything os fine.

Re: After selecting column visibility in DG table, code stops

Posted: Wed Dec 13, 2023 7:12 pm
by dunbarx
CAsba.

Really? And that was the only thing in the stack you noticed that was amiss?

Anyway, glad it is resolved. I have only had to reload LC once in my life to fix some sort of recalcitrant problem. I have had to delete the preferences file a couple of dozen times, still not too bad. I wonder if that would have solved your problem as well.

Craig