- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-26-2022 09:12 PM
Hi,
I am trying to build a custom widget where I am trying to use the sn-choice-list and sp-date-picker for the choice dropdown and datetime fields.
I have a requirement to make those fields read only and editable based on a "Edit" button.
When I try using direct scope element it's working fine
<sn-choice-list sn-disabled="fieldReadOnly" sn-model="c[field.name]" sn-options="field.choiceListOption" sn-value-field="value" sn-text-field="display_value" sn-items="field.choices"></sn-choice-list>
When I try to use directive under the ng-repeat and passing the dynamic 'c' object it's not working (either a boolean or function)
<sn-choice-list sn-disabled="c[field.readonly]" sn-model="c[field.name]" sn-options="field.choiceListOption" sn-value-field="value" sn-text-field="display_value" sn-items="field.choices"></sn-choice-list>
OR
<sn-choice-list sn-disabled="field.isReadOnly()" sn-model="c[field.name]" sn-options="field.choiceListOption" sn-value-field="value" sn-text-field="display_value" sn-items="field.choices"></sn-choice-list>
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-26-2022 09:17 PM
Hi
Try this:
<sn-choice-list readOnly = "{{c.readOnlyChoiceList}}"></sn-choice-list>
Replace readOnlyChoiceList with fieldReadOnly.
Regards,
Snehangshu Sarkar
Please mark my answer as correct if it resolves your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-26-2022 09:17 PM
Hi
Try this:
<sn-choice-list readOnly = "{{c.readOnlyChoiceList}}"></sn-choice-list>
Replace readOnlyChoiceList with fieldReadOnly.
Regards,
Snehangshu Sarkar
Please mark my answer as correct if it resolves your query.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-26-2022 09:38 PM
Thanks ng-readonly worked.
<sn-choice-list ng-readonly="c[field.readonly]" sn-model="c[field.name]" sn-options="field.choiceListOption" sn-value-field="value" sn-text-field="display_value" sn-items="field.choices"></sn-choice-list>
But it's not working in <sp-date-picker> directive