surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.12k stars 802 forks source link

checkbox question - render none below other item #1531

Closed andrewtelnov closed 5 years ago

andrewtelnov commented 5 years ago

Make sure that none item is rendered on the bottom. under the other item.

theriddler commented 2 years ago

image

I've recently started experiencing this problem again in the past 3 months (version 1.9.35), but I cannot isolate when it began happening.... Should I create a new issue for this?

note: thank you guys for your hard work, the product is quite amazing

JaneSjs commented 10 months ago

Hello @theriddler, Just wanted to inform you that we introduced an option to place the None item at the end of the list. With SurveyJS v1.9.117 and newer, it is made possible to position special choice items (None, Other, Select All) above or below other choice items in select-based questions (Checkboxes, Radio Button Group, Single- and Multi-Select Dropdown).

To specify new positions for the special choices, use the specialChoicesOrder object within global survey settings. This object contains the following properties: selectAllItem, noneItem, and otherItem. Each of them accepts an array of integer numbers.

Negative numbers place a special choice item above regular choice items, positive numbers place it below them.

For instance, the code below places the None option at the end of a list: View CodeSandbox.

import { settings } from "survey-core";

settings.specialChoicesOrder.noneItem = [2];
settings.specialChoicesOrder.selectAllItem = [-1];
settings.specialChoicesOrder.otherItem = [1];

A Checkboxes question appears as follows: image Please feel free to test the new feature. Should you have any further questions, feel free to contact us at any time.

Thanks