How do i update a property of a property on a element with a watcher? #139
Unanswered
Tim-Wapenaar-Fenetre
asked this question in
Questions
Replies: 1 comment
-
Hi Tim, The watcher only watches and can update field values not properties. To do this, you have actually a much easier job: const EndDateField = class extends BaseElementField {
name = 'EndDateField';
get schema() {
const min = this.elementSchema.startDate || new Date();
return {
endDate: {
type: 'date',
label: 'End date',
rules: ['required'],
min,
date: true,
time: true,
},
};
}
}; There's a list of props and methods that you can rely on while creating fields. Here's a full working demo: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have a CustomElement that has a start and end date.
For the end date i want to update the min property to be the value of the start date.
But i cant get the property to update.
I've tried, like the following, with
el$.update
but that updates the value of endDate not the min property. i've triedel$.load
,this.load
andthis.update
.Am i missing something?
Beta Was this translation helpful? Give feedback.
All reactions