Premium support for our pure JavaScript UI components


Post 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


Post 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
                        }
                    ]
                };
            }
        }
    ],
Attachments
Screen Shot 2022-09-23 at 17.23.17.png
Screen Shot 2022-09-23 at 17.23.17.png (53.51 KiB) Viewed 172 times

Best regards,
Márcio


Post by bherford »

Thanks


Post Reply