Dynamic text (read-only)
Dynamic text (read-only)
nskwortsow
Posts: 120Questions: 0Answers: 0
In the Editor input form, I want to have a read-only field (ideally, no input, but only text) which is displayed conditionally, based on an integer value (this integer is provided by the joined table).
E.g.
if (x=1) > display: Audience: doctors
if (x=2) > display: Adience: patients
1) How can I achieve this result?
(code below doesn't work, and readonly isn't intuitive)
,{
"label": "Audience:",
"labelInfo":,
"type": "readonly"
}
E.g.
if (x=1) > display: Audience: doctors
if (x=2) > display: Adience: patients
1) How can I achieve this result?
(code below doesn't work, and readonly isn't intuitive)
,{
"label": "Audience:",
"labelInfo":,
"type": "readonly"
}
This discussion has been closed.
Replies
{
"label": "Audience:",
"name":"tblFAQCategories.IsPatientCat",
"default":tblFAQCategories.IsPatientCat,
"type": "readonly"
}
But never mind: it is probably not possible with this pluging (data-dependent showing based on which SELECT is chosen in the form)
[code]
editor.on( 'onPreEdit', function () {
editor.val( 'tblFAQCategories.IsPatientCat', editor.val('getField?') === 1 ? 'Audience: doctors' : 'Audience: patients' );
} );
[/code]
Allan
How would I concatenate two values in the SELECT box?
I.e.
Current code:
editor_faqQuestions.field('f_FAQCID').update( json.tblFAQCategories );
json.tblFAQCategories is provided in a separate query:
->select( 'tblFAQCategories', 'FAQCID as value, FAQCName as label' )
)
However, there is a field "IsPatientCat" (value 0/1) for each category. Can I include this in the above query?
My goal is to populate the SELECT box with
FAQCName ({if (IsPatientCat == 0 ) ? Therapists : Patients })
Any suggestions for me?
#
Also: where can I find documentation on the Field>update method?
$out['userList'] = array();
while ( $row = $userList->fetch() ) {
$out['userList'][] = array(
"value" => $row['id'],
"label" => $row['id'].' '.$row['first_name'].' '.$row['last_name']
);
}
Allan
Hmmm - unfortunately that isn't actually correctly documented on the site. Thanks for picking that up - I will ensure that is rectified. Basically it is just a call for the select, checkbox and radio methods to update the source data.
Allan