Skip to content

Commit

Permalink
onConditionQuestionsGetList: Describe the variables parameter (#5729
Browse files Browse the repository at this point in the history
)
  • Loading branch information
RomanTsukanov authored Jul 26, 2024
1 parent 59e2b6a commit 0f60618
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/survey-creator-core/src/creator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export class SurveyCreatorModel extends Base
*/
public onSurveyPropertyValueChanged: EventBase<SurveyCreatorModel, PropertyValueChangedEvent> = this.addCreatorEvent<SurveyCreatorModel, PropertyValueChangedEvent>();
/**
* An event that is raised when a condition editor renders a list of questions available for selection. Use this event to modify this list.
* An event that is raised when a condition editor renders a list of questions and variables available for selection. Use this event to modify this list.
*/
public onConditionQuestionsGetList: EventBase<SurveyCreatorModel, ConditionGetQuestionListEvent> = this.addCreatorEvent<SurveyCreatorModel, ConditionGetQuestionListEvent>();

Expand Down Expand Up @@ -2069,12 +2069,12 @@ export class SurveyCreatorModel extends Base
return new SurveyJSON5().stringify(json, null, indent);
}
private moveElementsToTheEnd(json: any): void {
if(!json) return;
if(Array.isArray(json)) {
if (!json) return;
if (Array.isArray(json)) {
json.forEach(el => this.moveElementsToTheEnd(el));
} else {
if(typeof json === "object") {
if(!!json["elements"]) {
if (typeof json === "object") {
if (!!json["elements"]) {
const els = json["elements"];
delete json["elements"];
json["elements"] = els;
Expand Down
5 changes: 4 additions & 1 deletion packages/survey-creator-core/src/creator-events-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,12 @@ export interface ConditionGetQuestionListEvent {
* A list of questions available for selection.
*/
list: any[];
/**
* A list of [calculated values](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#calculated-values) and [variables](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#variables) available for selection.
*/
variables: string[];
/**
* The sort order of questions within the list: `"asc"` (default) or `"none"`. Set this property to `"none"` to disable sorting.
* The sort order of questions within both list: `"asc"` (default) or `"none"`. Set this property to `"none"` to disable sorting.
*/
sortOrder: string;
}
Expand Down

0 comments on commit 0f60618

Please sign in to comment.