User tests: Successful: Unsuccessful:
Pull Request for Issue #8996 .
After this PR radio fields can be readonly
and single options of it can be disabled
. Furthermore I adjusted the solution from @dgt41 in #10969 to fit with the solution of disabled
options and readonly
.
disabled
or readonly
attribute or add the disabled
attribute to a single option.btn-group
and test again (In Beez3 you won't see a difference as the css code for btn-group
is missing. See #12029.)(I've applyed disabled, readonly and disabled option for illustrating. For testing please use only one at time since they have similar effects.)
<field
type="radio"
default="1"
disabled="true"
readonly="true"
class="btn-group"
>
<option value="1">JYES</option>
<option value="0" disabled="true">JNO</option>
</field>
none
Btw.: Why isn't the JavaScript code related to btn-group
in a central file so that all templates can use it without copying it? A central file would result in one file to update instead applying the same change on multiple files by multiple developers because every template developer must apply the fix himself.
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Templates (admin) Administration Installation Layout Templates (site) Front End |
Labels |
Added:
?
|
Now there is a readonly
class on readonly radio fields.
I have tested this item
Patch tested successfully
@ggppdk can you please test so we get the needed 2nd one?
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-12-23 16:09:30 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
I would like to see this fixed, as now i am doing this, with my own code, adding it in views that have bootstrap styled radio fields that are "readonly"
So that you can have non-bootstrap templates ...
and / or make easier to use other bootstrap version,
and also to allow customizing it per template,
that is why this code is in every single template
Comments about changes of this PR:
i see that this PR removes the JS code and move the adding of the INLINE styling and of the 'disabled' class into the LAYOUT file of radio field, this means that radio-set fields that do not use this layout will no longer work, maybe this is acceptable (since the adding of the JS code was done in J3.6.1 so ... the B/C break is minor because the removed JS code can be removed since it is "recent") ?
also this PR adds the same class to fieldset TAG "disabled" for both the cases that the radio-set is disabled / readonly. For B/C display i see the benefit of adding 'disabled' class to the FIELDSET, but at least 1 more class should be there to allow different styling that would be "readonly" CSS class ?
[EDIT]
3rd template or custom code that already use the JS code , that this PR removes, should not have a problem,
as they will just re-add CSS styling and a CSS class ('disabled') , that already exists in the HTML code, so i do not see an issue, if some 3rd party code tries to add, what we already have in J3.6.1+ via JS