Are you requesting a feature, reporting a bug or asking a question?
Question
What is the current behavior?
Say I have a function toUpper that changes a string to upper case.
I create the survey model but only after it has been created the function toUpper is registered.
Can I tell the survey model to re-evaluate all calculations?
Notes:
This is all happening before the survey is rendered for the first time
I do not control the function registration, while I can detect when it happens called I cannot control when it happens
What is the expected behavior?
Ideally surveyJS should detect any function registration and update the relevant expressions automatically.
Alternatively there should be a clean way to notify SurveyJS that something has changed. For calculated values specifically I can work around it by doing this:
But this is not feasible for things like visibleIf, I'd have to iterate recursively over every element and check every expression again.
Instead the proper solution is to add the function definition as a dependency and recalculate when the dependency is changed.
How would you reproduce the current behavior (if this is a bug)?
I don't think it's a bug but you can see demo sandbox below.
Provide the test code and the tested page URL (if applicable)
Are you requesting a feature, reporting a bug or asking a question?
Question
What is the current behavior?
Say I have a function
toUpper
that changes a string to upper case. I create the survey model but only after it has been created the functiontoUpper
is registered.Can I tell the survey model to re-evaluate all calculations? Notes:
What is the expected behavior?
Ideally surveyJS should detect any function registration and update the relevant expressions automatically.
Alternatively there should be a clean way to notify SurveyJS that something has changed. For calculated values specifically I can work around it by doing this:
But this is not feasible for things like
visibleIf
, I'd have to iterate recursively over every element and check every expression again. Instead the proper solution is to add the function definition as a dependency and recalculate when the dependency is changed.How would you reproduce the current behavior (if this is a bug)?
I don't think it's a bug but you can see demo sandbox below.
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://codesandbox.io/p/sandbox/stupefied-cartwright-zdyrqt NOTE Due to the way knockout and the sandbox work, make sure you do an actual reload when testing changes.
Specify your