Closed strets123 closed 9 months ago
Hello @strets123 the code is located here: https://github.com/formio/formio.js/blob/master/src/widgets/CalendarWidget.js#L207
I hope that this helps. Thank you for taking a look.
Please let us know if you have any further questions.
Have a great weekend.
I think this issue is still there, isn't it?
The data
object containing the form data is not available in the disableFunction. It is usually the case for other custom functions (like validators, default values, etc.), where the whole submission data object of the form is accessible.
If I am not mistaken, the initial date
argument is extended in this function But the form data submission object is not exposed there and therefore I did not find a way how to access the data object.
I can confirm. But as a workaround you can access data
within disableFunction
via instance?.componentInstance?.data
, e.g.
"disableFunction": "console.log('data from disableFn', instance?.componentInstance?.data); false"
We're currently addressing a backlog of GitHub issues. Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!
Environment
Please provide as many details as you can:
Steps to Reproduce
Expected behavior
Observed behavior
Example
If possible, please provide a screenshot, live example (via JSFiddle or similar), and/or example code to help demonstrate the issue.
Here is a link to my deployed form
https://pro.formview.io/#/eixfevfdchjtmuo/datefields?header=1&reset=1
Here is my function configuration - I expect data to be available as per the instructions for the custom disable dates field.
Here is what happens when I use the form
I am evaluating Form.io for use in the order entry process for a number of high profile customers. It would be great to hear back in the next couple of weeks after my holiday as complex date functionality is a big part of this application.
I would consider authoring a fix give a few clues where to look in the code.
Here is my JSON definition: