Hiding properties from the type survey on load - SurveyJS Angular

Discussão em 'Angular' iniciado por drew schmaltz, Outubro 23, 2024.

  1. I am trying to hide properties (well, the whole tab) - in this case "Quiz Mode" on the type "survey". This works if you click an element and return back to the default property (clicking the background of the survey). However, onShowingProperty doesn't fire for that first load, nor does the serializer. In both cases, Quiz Mode is only hidden upon returning to the "survey" panel.

    I've tried a few other onEvents and haven't got this working...

    const creator = new SurveyCreatorModel(creatorOptions);
    const black_list = ['showTimer', 'timerLocation', 'timeLimit', 'timeLimitPerPage', 'timerInfoMode'];
    // the first way...
    black_list.forEach(property => {
    Serializer.getProperty('survey', property).visible = false;
    })
    // the second way...
    creator.onShowingProperty.add(function (_, options) {
    if (options.obj.getType() == "survey") {
    options.canShow = !black_list.includes(options.property.name);
    }
    });

    Continue reading...

Compartilhe esta Página