JayEdgar
Posts: 77
|
Posted: 02/06/2014, 9:22 AM |
|
I'm attempting to dynamically disable a checkbox in an editable grid based on values in the record. I've reviewed all the posts on this and looked in the help file. I find this:
PHP
if (CCGetParam('mode', '') == 'profile') {
$Component->Attributes->SetValue('disabled', 'disabled');
}
I'm using CCS v. 4.3, and this should work. It doesn't. Specifically, I'm using this code:
$Results->Used->Attributes->SetValue('disabled','disabled');
My form name is Results and Used is the checkbox name. If I output the array of $Results->Used->Attributes, it appears to be getting set, but it is not being disabled. I'd really prefer to not have to use JS to accomplish this.
Can anyone help?
Thanks a lot,
Jay
|
|
|
eratech
Posts: 513
|
Posted: 02/06/2014, 7:20 PM |
|
Hi Jay
The Manual example is "Working With Component Attributes" right?
I've recently been using Attributes, and found that I needed to create the Attribute on the control (control Property >Attributes, Create new 'disabled'), and the in the HTML view, right-click and 'Insert Attribute' , and select from the 'Existing Attributes'
It wasn't obvious as I started with typing in HTML like the example and it didn't work. I think the creation of the Attribute generates some more code in the background, that simply adding the {thing:attribute} doesn't.
Or have I assumed something not in evidence?
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
JayEdgar
Posts: 77
|
Posted: 02/07/2014, 5:58 AM |
|
Eratech, you are a scholar and a gentleman. Unfortunately, I cannot click on the button to create Attributes without CCS crashing. *sigh* oh well, workaround here we come. : )
Thanks again.
Jay
|
|
|
eratech
Posts: 513
|
Posted: 02/10/2014, 3:44 PM |
|
I know it works on my CCS 4.3 projects, haven't tried in 5.1 yet.
Shame - Attributes are quite powerful.
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
|