Premium support for our pure JavaScript UI components


Post by pincherhgz »

we have configured a percentage column in a grid. We want to hide the percentage bar for specific rows. Normally we can do that with a renderer where we can do that using i.e.

widgets[0].hidden = true

with the percentage column this is not possible as there are no widgets passed.

Any idea ?


Post by ghulam.ghous »

Hi @pincherhgz,

You can use renderer of percentColumn to achieve this: https://bryntum.com/products/grid/docs/api/Grid/column/PercentColumn#config-renderer

        {
            type  : 'percent',
            text  : 'Percent',
            field : 'percent',
            flex  : 1,
            renderer(data) {

            const domConfig = this.defaultRenderer(data);

            if (data.value == 21) {
                return null;
            }

            return domConfig;
        }
    }

And if you want to disbale the editor as well, you can use beforeCellEditStart event https://bryntum.com/products/grid/docs/api/Grid/feature/CellEdit#event-beforeCellEditStart and check for percent column and your condition and return false to prevent the editor.

Regards
Ghous


Post by pincherhgz »

GHous, great reply, that works, thanks


Post by ghulam.ghous »

Hi @pincherhgz,

Glad to hear that it worked. If you need any further assistance, please don't hesitate to reach out to us.

Regards,
Ghous


Post Reply