Premium support for our pure JavaScript UI components


Post by sachidanand »

Hello,

I am trying to apply some dynamic styles(show/hide icon conditionally) to an "Action" column in Bryntum Gantt but that does not seem to work.
Though, same works if column is not of action type.
I am using renderer function to apply the styles(class).


Post by alex.l »

ActionColumn has visible property for action to manage that:
https://bryntum.com/docs/gantt/api/Grid/column/ActionColumn

            columns : [
                {
                    type    : 'action',
                    text    : 'Actions',
                    width   : 100,
                    actions : [{
                        renderer : ({ action, tooltip }) => `<i data-btip="${tooltip}" class="b-fa b-fa-edit b-action-item"></i>`,
                        onClick  : () => clickCalled = true
                    }, {
                        cls     : 'b-fa b-fa-times',
                        visible : false
                    }, {
                        cls     : 'b-fa b-fa-plus',
                        visible : ({ record }) => false
                    }, {
                        cls     : 'b-fa b-fa-minus',
                        tooltip : () => '<b class="b-test-tooltip">Tooltip note</b>',
                        visible : ({ record }) => !Boolean(record.children && record.children.length)
                    }, {

It also has own renderer for every action, default renderer won't work here.

All the best,
Alex


Post by sachidanand »

Thanks Alex, this is exactly what I was looking for.


Post Reply