Skip to content

Commit

Permalink
Add an example for addCollectionItemsJson
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanTsukanov committed Mar 4, 2024
1 parent 86370f4 commit 96e7a2b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/survey-creator-core/src/creator-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,21 @@ export class SurveyCreatorModel extends Base
}
/**
* Adds new items to the [`pages`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#pages), [`triggers`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#triggers), [`calculatedValues`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#calculatedValues), and [`completedHtmlOnCondition`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedHtmlOnCondition) arrays in the existing survey JSON schema.
*
* Use this method to merge the collection properties of two survey JSON schemas:
*
* ```js
* import { SurveyCreatorModel } from "survey-creator-core";
* const creatorOptions = { ... };
* const creator = new SurveyCreatorModel(creatorOptions);
*
* const surveyJson1 = { ... };
* const surveyJson2 = { ... };
*
* creator.JSON = surveyJson1;
* creator.addCollectionItemsJson(surveyJson2);
* // `creator.JSON` contains the merged survey JSON schema
* ```
* @param json A JSON object that contains the `pages`, `triggers`, `calculatedValues`, and/or `completedHtmlOnCondition` array(s).
* @param insertPageIndex A zero-based index at which to insert new pages.
*/
Expand Down

0 comments on commit 96e7a2b

Please sign in to comment.