Question/Bug
Using Survey knockout I've created a custom widget myButton , the fact is that I can add a custom property and I can remove it, but Survey is adding some default props that I can't access and I want to remove some of them from only my 'myButton', not for all 'question'.
If I remove a property from the final object then this property should not exist.
Create a custom widget, add some property and then see if SurveyKo.JsonObject.metaData.getProperties('myButton') has the default and adedd properties and
try to remove some of default properties like placeholder from 'myButton'.
import * as SurveyKo from 'survey-knockout';
SurveyKo.JsonObject.metaData.addClass('myButton',
[
{ name: 'buttonText', default: 'btn text'},
{ name: 'buttonClickEvent', default: '// Whatever' }
],
null, 'empty');
SurveyKo.JsonObject.metaData.removeProperty('myButton', 'valueName');
const defaultProps = Survey.JsonObject.metaData.getProperties('myButton');
console.log(defaultProps)
This removeProperty should remove the default property but it's not working.


How can I remove the property only for my widget instead of all question?
Do you want to remove these properties from the SurveyJS Creator?
You can make certain properties invisible in SurveyJS Creator using the following code:
Survey
.Serializer
.addProperty("checkbox", {name: "readOnly", default: false, visible: false});
E.g. this code ovverrides default readOnly property for checkbox question and makes it invisible in SurveyJS Creator
Here is the working sample - https://plnkr.co/edit/lNPaGksHdykFshRj
At the first I wanted to eliminate them but if I can hide them it's better, Thank you!!
Most helpful comment
You can make certain properties invisible in SurveyJS Creator using the following code:
E.g. this code ovverrides default
readOnlyproperty forcheckboxquestion and makes it invisible in SurveyJS CreatorHere is the working sample - https://plnkr.co/edit/lNPaGksHdykFshRj