SurveyJS v1.11.10
Released: August 7, 2024
SurveyJS v1.11.10 introduces an event that allows you to display dropdowns as classic drop-down menus, pop-up dialogs, or overlay windows and a function that defines custom parsing rules for numbers.
Dynamically change drop-down menu UI
In SurveyJS Form Library, dropdowns can appear as a classic drop-down menu, a pop-up dialog, or an overlay window. Form Library selects the most suitable dropdown UI automatically based on the device where the survey is displayed. In this release, we add a new onOpenDropdownMenu
event that allows you to override this behavior and select a required dropdown type based on a custom logic. For instance, the following code shows how to apply a classic drop-down menu UI on tablets:
import { Model } from "survey-core";
const surveyJson = { ... }
const survey = new Model(surveyJson);
survey.onOpenDropdownMenu.add((_, options) => {
if (options.deviceType === "tablet") {
options.menuType = "dropdown";
}
});
Define custom parsing rules for numbers
In SurveyJS, numeric strings are converted to numeric values according to generally accepted rules. Parsing an incorrect numeric string results in NaN
. In this release, we add a parseNumber
function that allows you to specify custom parsing rules for numbers and handle required cases of incorrect numeric notation. For example, the code below shows how to convert an incorrect numeric string, such as "123,0134"
, to a correct numeric value (1230134
). Without the parseNumber
function, such conversion would produce NaN
.
import { settings, Helpers } from "survey-core";
settings.parseNumber = (stringValue, numericValue) => {
if (typeof stringValue !== "string" || !stringValue || stringValue.indexOf(",") < 0)
return numericValue;
// Remove commas from the string value
while(stringValue.indexOf(",") > -1) {
stringValue = stringValue.replace(",", "");
}
// Pass the string value for further processing
return Helpers.getNumber(stringValue);
};
New Help Topics
How to Use Column Totals in Matrix Questions
How to Use Custom Variables in Form Calculations
New and Updated Demos
Survey Creator: Add a Modal Editor to the Property Grid
Bug Fixes and Minor Enhancements
Form Library
onDownloadFile
is not raised for Signature Pad questions that store signature images by name (#8575)- Survey content overlaps the Table of Contents after the ToC adapts to a smaller screen size (#8636)
navigateToUrlOnCondition
stopped working (#8631)panelsState
doesn't work in a Dynamic Panel with piped answers (#8653)- Image question:
imageFit
doesn't work correctly in a complex layout (#8637) - Custom expression properties do not work when they are added to a choice item definition (#8641)
Survey Creator
- Multi-Select Matrix:
showInMultipleColumns
is reset tofalse
after editing a column cell (#5750)
Dashboard
- HTML and Image questions should be hidden from the Table View by default (#455)
How to Update SurveyJS Libraries in Your Application
Angular
npm i survey-core@1.11.10 survey-angular-ui@1.11.10 --save
npm i survey-creator-core@1.11.10 survey-creator-angular@1.11.10 --save
npm i survey-analytics@1.11.10 --save
npm i survey-pdf@1.11.10 --save
React
npm i survey-core@1.11.10 survey-react-ui@1.11.10 --save
npm i survey-creator-core@1.11.10 survey-creator-react@1.11.10 --save
npm i survey-analytics@1.11.10 --save
npm i survey-pdf@1.11.10 --save
Vue 3
npm i survey-core@1.11.10 survey-vue3-ui@1.11.10 --save
npm i survey-creator-core@1.11.10 survey-creator-vue@1.11.10 --save
npm i survey-analytics@1.11.10 --save
npm i survey-pdf@1.11.10 --save
Vue 2
npm i survey-core@1.11.10 survey-vue-ui@1.11.10 --save
npm i survey-creator-core@1.11.10 survey-creator-knockout@1.11.10 --save
npm i survey-analytics@1.11.10 --save
npm i survey-pdf@1.11.10 --save
Knockout / jQuery
<link href="https://unpkg.com/survey-core@1.11.10/defaultV2.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/survey-core@1.11.10/survey.core.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/survey-knockout-ui@1.11.10/survey-knockout-ui.min.js"></script>
<link href="https://unpkg.com/survey-creator-core@1.11.10/survey-creator-core.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/survey-creator-core@1.11.10/survey-creator-core.min.js"></script>
<script src="https://unpkg.com/survey-creator-knockout@1.11.10/survey-creator-knockout.min.js"></script>
<link href="https://unpkg.com/survey-analytics@1.11.10/survey.analytics.min.css" rel="stylesheet">
<script src="https://unpkg.com/survey-analytics@1.11.10/survey.analytics.min.js"></script>
<script src="https://unpkg.com/survey-pdf@1.11.10/survey.pdf.min.js"></script>