Survey Now v1.11.10
Released: August 7, 2024
Survey Now 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 Survey Now 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 Survey Now, 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
onDownloadFileis 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)
navigateToUrlOnConditionstopped working (#8631)panelsStatedoesn't work in a Dynamic Panel with piped answers (#8653)- Image question:
imageFitdoesn'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:
showInMultipleColumnsis reset tofalseafter editing a column cell (#5750)
Dashboard
- HTML and Image questions should be hidden from the Table View by default (#455)
How to Update Survey Now Libraries in Your Application
Angular
npm i [email protected] [email protected] --save
npm i [email protected] [email protected] --save
npm i [email protected] --save
npm i [email protected] --save
React
npm i [email protected] [email protected] --save
npm i [email protected] [email protected] --save
npm i [email protected] --save
npm i [email protected] --save
Vue 3
npm i [email protected] [email protected] --save
npm i [email protected] [email protected] --save
npm i [email protected] --save
npm i [email protected] --save
Vue 2
npm i [email protected] [email protected] --save
npm i [email protected] [email protected] --save
npm i [email protected] --save
npm i [email protected] --save
Knockout / jQuery
<link href="https://unpkg.com/[email protected]/defaultV2.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/[email protected]/survey.core.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/survey-knockout-ui.min.js"></script>
<link href="https://unpkg.com/[email protected]/survey-creator-core.min.css" type="text/css" rel="stylesheet">
<script src="https://unpkg.com/[email protected]/survey-creator-core.min.js"></script>
<script src="https://unpkg.com/[email protected]/survey-creator-knockout.min.js"></script>
<link href="https://unpkg.com/[email protected]/survey.analytics.min.css" rel="stylesheet">
<script src="https://unpkg.com/[email protected]/survey.analytics.min.js"></script>
<script src="https://unpkg.com/[email protected]/survey.pdf.min.js"></script>