Skip to content

Select one of available icons #5334

Answered by wezmag
milenkovicstefan asked this question in Help
Discussion options

You must be logged in to vote

You can create a custom editor inherit from RadioButtonEditor, and then override constructor and addRadio methods.

BTW, it's better to load data (id, image url, and etc...) from the database, rather than get file info directly from the directory.

namespace YourProjectName {

    @Serenity.Decorators.element('<div />')
    @Serenity.Decorators.registerEditor([Serenity.IStringValue, Serenity.IReadOnly])
    export class IconSelectEditor extends Serenity.RadioButtonEditor {

        constructor(div: JQuery, opt: any) {
            super(div, opt);

            //load data from backend
            //Common.IconService.ListIcons({}, response => {
            //    response.Icons.forEach(icon => {

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@milenkovicstefan
Comment options

Answer selected by milenkovicstefan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants