survey-creator icon indicating copy to clipboard operation
survey-creator copied to clipboard

Choices - Introduce an API which would allow defining the value for choices added via a Fast Entry editor

Open JaneSjs opened this issue 1 year ago • 0 comments

T18227 - Automatic choice injection https://surveyjs.answerdesk.io/internal/ticket/details/T18227


When you use the fast entry editor, you expect to specify the value and text separated by |.

1 | Option-1
2 | Option-2
3 | Option-3
4 | Option-4
5 | Option-5

image

Choices with a corresponding value and text will be created. image

However, if you do not explicitly specify the value attribute, as follows:

Option-1
Option-2
Option-3
Option-4
Option-5

Those strings will be used as values: image

In a usage scenario, it's required to use supplied strings as texts and auto-generate ordered numbers for these choices to achieve the following output: image

Consider introducing an API which would allow developers to manage auto-generated choices and override their values and texts. For the record: creator.onItemValueAdded is raised only when adding a new choice via the Add New button.

JaneSjs avatar May 21 '24 09:05 JaneSjs