spDatePicker ReadOnly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-29-2022 07:55 PM
Hi,
I am trying to build a custom widget where I am trying to use the sp-date-picker for 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
<sp-date-picker ng-if="field.type == \'date\'" field="field" ng-model="c[field.name]" sn-disabled="fieldReadOnly" ></sp-date-picker>'
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)
<sp-date-picker ng-if="field.type == \'date\'" field="field" ng-model="c[field.name]" sn-disabled="c[field.readOnlyName]" ></sp-date-picker>'
OR
<sp-date-picker ng-if="field.type == \'date\'" field="field" ng-model="c[field.name]" sn-disabled="field.isReadOnly()" ></sp-date-picker>'
Thanks in advance.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-30-2022 03:00 AM
Hi,
You can set attribute
sn-disabled="true"
true/false based on condition in edit button.
or take value of field.isReadOnly() in data object and pass it to html and check it is true or not
please mark helpful /correct based on impact
Regards,
Aniket S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-30-2022 06:03 AM
Hi,
I already tried using field.isReadOnly() but it's not working.
If it works for you, please share the code.
Thanks