Page 1 of 1

[ANGULAR] Trying to render out a checkbox with a label in a column cell

Posted: Fri Sep 23, 2022 10:13 pm
by bherford

I am trying to render a checkbox and label into my column cell using this config:

    { type: 'name', text: 'Name', field: 'name', width: 250,
        renderer : ({ record }) => {
            return {
                class : 'myClass',
                children : [
                    {
                        tag : 'i',
                        class : 'fa fa-pen'
                    },
                    {
                        tag : 'input',
                        type : 'checkbox',
                        html : record.name,
                    }
                ]
            };
        }
    },

But I can't seem to output anything other than a text input. Is there another method to do this?

Thanks


Re: [ANGULAR] Trying to render out a checkbox with a label in a column cell

Posted: Fri Sep 23, 2022 10:23 pm
by marcio

Hey bherford,

Using last version of Bryntum's libraries, you can have the checkbox with some text beside it like this


  columns : [
        {
            type     : 'name',
            text     : 'Name',
            field    : 'name',
            width    : 250,
            renderer : ({ record }) => {
                return {
                    class    : 'myClass',
                    children : [
                        {
                            tag   : 'i',
                            class : 'fa fa-pen'
                        },
                        {
                            tag  : 'input',
                            type : 'checkbox'
                        },
                        {
                            tag  : 'span',
                            html : record.name
                        }
                    ]
                };
            }
        }
    ],

Re: [ANGULAR] Trying to render out a checkbox with a label in a column cell

Posted: Wed Sep 28, 2022 2:39 pm
by bherford

Thanks