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

Introduce an API to override a default renderer for all questions of a specific type #8234

Closed
andrewtelnov opened this issue May 4, 2024 · 0 comments
Assignees
Labels
enhancement user issue An issue or bug reported by users
Milestone

Comments

@andrewtelnov
Copy link
Member

andrewtelnov commented May 4, 2024

IMPLEMENTED

The registerRenderer method now has a Boolean parameter—useAsDefault. Pass true if you want to use the renderer you are registering as a default renderer for questions of a specifed type:

import { RendererFactory } from "survey-core";

// ...

RendererFactory.Instance.registerRenderer(
    "radiogroup",
    "radiogroup-with-image",
    "sv-radiogroup-with-image",
    true // Use "sv-radiogroup-with-image" as a default renderer for questions of a "radiogroup" type
);

View Demo

@andrewtelnov andrewtelnov added enhancement user issue An issue or bug reported by users labels May 4, 2024
@andrewtelnov andrewtelnov self-assigned this May 4, 2024
@andrewtelnov andrewtelnov added this to the v1.10.3 milestone May 4, 2024
andrewtelnov added a commit that referenced this issue May 4, 2024
@tsv2013 tsv2013 closed this as completed in a35d8cb May 6, 2024
@RomanTsukanov RomanTsukanov changed the title Allow to override the default rendered in RendererFactory singleton Introduce an API to override a default renderer for all questions of a specific type May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

1 participant