Question T22464
Visible to All Users

Is there a way to place the Select All item at the bottom?

created 10 days ago

The client has asked for the "Select all" option to be at the bottom of the choices list, with the label "All of the above". But I haven't seen a field that could help me with this in the Checkbox question documentation. See example:

JSON
{ "pages": [ { "name": "page1", "elements": [ { "type": "checkbox", "name": "1.29.2 Which board subcommittee(s) do you present to at least annually?", "title": "Which board subcommittee(s) do you present to at least annually?", "description": "Select all that apply.", "isRequired": true, "choices": [ "Executive committee", "Finance committee", "Audit committee", "Governance committee", "Risk committee", "ESG/sustainability/business responsibility committee" ], "showOtherItem": true, "otherText": "Other (please specify)", "otherErrorText": "Please specify.", "showSelectAllItem": true, "selectAllText": "All of the above" } ] } ], "headerView": "advanced" }

Is there a way to achieve this?
Thank you!

Answers approved by surveyjs Support

created 9 days ago

Hello Leticia,
You can reorder special choices (Select All, None, Other) using the settings.specialChoicesOrder property. To position the Select All option at the end of the choice list, set settings.specialChoicesOrder.selectAllItem to a positive number greater than the index of the Other option. For example, set it to 5:

JavaScript
import { settings } from "survey-core"; settings.specialChoicesOrder.selectAllItem = [ 5 ];

View Demo
Clipboard-File-1.png

Let me know if you have any further questions.