Hello my awesome surveyjs team,
need a help/example to add a validators type property with my own choices
So the overall feature I am trying to build is ->
#1 - Loading a definition list from ajax (countries, regions, users etc master records and it's a custom property of type itemvalues)
#2 - Than once select a definition type, say 'countries' than it will load another custom property of type validators. Which should have values like text, order by, row counts etc. (in this one I am stuck and need urgent help)
#3 - Next if you choose say 'text' than it will load 3 new text box like the validation text selection is doing now(I think I can do this, once I manage to do the #2)
#4 - This setting will filter the list of definition that will be loading in the survey viewer
(the feature we are trying to build is: load any master record as a dropdown list type question also filter on text/order by/row count on top of that)
(i am following this documentation : Add Properties to creator doc)
CodeSurveyKo.Serializer.addProperty("selectbase", {
name: 'definitionFilters:validators',
default: ' ',
dependsOn: ["definitions", "choiceType"],
visibleIf: function (obj) {
var definitions = !!obj ? obj.definitions : null;
var choiceType = !!obj ? obj.choiceType : null;
if (definitions !== 'choose' && choiceType === 0) {
return true;
}
else {
return false;
}
},
// choices: [
// { text: "Choose", value: -1 },
// { text: "Text", value: 0 },
// { text: "Order", value: 1 },
// { text: "Top rows {row number}", value: 2 },
// ],
category: "New"
});
Hello,
What is the final goal? Do you want to restrict validators type for selectbase questions (checkbox, radiogroup, dropdown, imagepicker)?
validators property type ignores "choices" property attribute.
Thank you,
Andrew
SurveyJS Team
Thanks for replying quicker than expected.
The goal is to utilize the 'validators' type control to define my own selction items(mytext/order by/rowcount instead of expression/numeric/text/regex/email)
And than on selection of any options(mytext/order by/rowcount) load/visible different properties(like the way validator does but this time my own custom properties).