surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
898 stars 373 forks source link

Disable lazy rendering of questions in Creator #5254

Closed jburghardt closed 6 months ago

jburghardt commented 7 months ago

Are you requesting a feature, reporting a bug or ask a question?

feature/question

What is the current behavior?

SurveyCreator does not show all questions when after initalizing it with a big json. Somehow the amount of Rows shown is dependent on the height the container has ( i think? )

What is the expected behavior?

SurveyCreator does render the Complete Survey loaded from JSON. If the user want lazy rendering of questions, it should be passed as an option to the Creator

e.g new SurveyCreator({ lazyRender: true })

How would you reproduce the current behavior (if this is a bug)?

This codePen is taken from the Demo. The container in which the Survey is loaded has a height of 500px. SurveyCreator will only render a couple of questions first, lazy loading all others while scrolling.

There is no way in the Creator to disable this

https://codepen.io/kcs-frontend/pen/KKELBBe

There are some issues around suggesting the LazyRowsRendering Options, but A. they do not work! B. If they did they should be part of the Options passed to the Creator !

Thanks and greetings!

andrewtelnov commented 7 months ago

We don't have lazyRender option. You can use creator.onDesignerSurveyCreated event as:

creator.onDesignerSurveyCreated.add((sender, options) => {
  options.survey.lazyRendering = false;
});

Please make sure to call it before creator.JSON = yourJSON; otherwise designer survey will be created already.

Thank you, Andrew

JaneSjs commented 6 months ago

Hello @jburghardt, SurveyJS Creator by default enables lazy loading/rendering of survey questions on a design surface. With this option, SurveyJS Creator can initialize a survey faster and progressively load questions as soon as users scroll a survey. This option is especially useful for large surveys.

If you are not satisfied with the behavior, you can disable lazy question rendering as Andrew mentioned.

Please feel free to reactivate this thread if you have any further questions.

Thanks