when I change checked not fire onSurveyPropertyValueChanged event
JavaScriptSurvey.Serializer.addProperty("questionbase", {
name: "checked",
displayName: "checked",
type: "boolean",
isRequired: false,
category: "general",
// visible: false,
default: false,
// isSerializable: false,
onSetValue: function (surveyElement, value) {
// You can perform required checks or modify the `value` here
// ...
// Set the `value`
surveyElement.setPropertyValue("checked", value);
// You can perform required actions after the `value` is set
// ...
}
});
Hello,
I created the following demo for your reference: View Demo. A new value of a
checked
custom property is correctly updated when I change it via the property grid.creator.onSurveyPropertyValueChanged.add((sender, options) => { console.log(options.value); });
Please let me know if it works on your side.
It still doesn't work. The version I'm using is jquery, not react. Can you provide testing for the jquery version
I understand ,addProperty should be used before new SurveyCreator.SurveyCreator
,otherwise,it will not listen by onSurveyPropertyValueChanged
I want to use onSurveyPropertyValueChanged event to change current question's Property of checked to true,it work ,but when I change the question of Upload to Rating Scale ,the event of onSurveyPropertyValueChanged change next question's Property to true,current question not working?
creator.onSurveyPropertyValueChanged.add((sender, options) => { if(options.name!="isChecked"){ options.obj.checked = true; } }
Hi,
Thank you for the update and clarification. Please use the
options.obj.setPropertyValue
function to update thechecked
property value.creator.onSurveyPropertyValueChanged.add((sender, options) => { if (options.name !== "isChecked") { options.obj.setPropertyValue("checked", true); } });
I created the following jQuery demo for your reference: View CodeSandbox. Please let me know if this works for you.
It still not working,when I change upload file to raking,It also set panel of 1.2 Greenhouse Gas Reporting file to government and Remark’s ischeck true,It does not what I want
Hello,
Thank you for the update. I would appreciate it if you modify my CodeSandbox demo to illustrate the issue.
I look forward to your reply.
I have modified my approach, how can I monitor the switching of problem types,which event will fire! when the question's type changed , checked property should be seted to true
example: change from single-line input to file upload