Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set null to creator.selectedElement #672

Closed
andrewtelnov opened this issue Feb 20, 2020 · 0 comments
Closed

Allow to set null to creator.selectedElement #672

andrewtelnov opened this issue Feb 20, 2020 · 0 comments
Milestone

Comments

@andrewtelnov
Copy link
Member

It is currently impossible to set creator.selectedElement to null. It would select the survey and as result show survey properties in the property.
By allowing to set the null value to creator.selectedElement, it will become possible do not show survey/page properties in the property grid. Here is the example that disable selecting survey and page:

      creator.onSelectedElementChanging.add(function(c, options) {
        var el = options.newSelectedElement;
        if (
          el != null &&
          (el.getType() == "page" || el.getType() == "survey")
        ) {
          options.newSelectedElement =
            creator.survey.getAllQuestions().length > 0
              ? creator.survey.getAllQuestions()[0]
              : null;
        }
      });

      //creator.JSON = YourSurveyJSON;
      creator.selectedElement = null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants