Premium support for our pure JavaScript UI components


Post by ogardnerffdc »

Hi,

We've just upgraded our Grid from 5.6.2 to 5.6.6. Upon upgrade, we've noticed that our custom CheckColumn throws an error when trying to access the widget:

Cannot read properties of undefined (reading '0')

This can be replicated using the following code:

import { Toast, Grid, DataGenerator, CheckColumn, ColumnStore, StringHelper } from '../../build/grid.module.js?474079';
import shared from '../_shared/shared.module.js?474079';

class CustomCheckColumn extends CheckColumn {
    static type = 'customCheck';

static get defaults() {
    return {
         maxWidth: 50,
         resizable: false
    };
}

renderer({ widgets }) {
    widgets[0].disabled = true;
}
}

ColumnStore.registerColumnType(CustomCheckColumn);

new Grid({

appendTo : 'container',

columns : [
    { type : 'rownumber' },
    {
        text     : 'Template',
        minWidth : 160,
        flex     : 1,
        field    : 'name',
        type     : 'template',
        template : data => StringHelper.xss`Hi ${data.record.name}!`,
        // Cheaper measuring when sizing to fit content
        fitMode  : 'value',
        editor   : {
            label : 'Name'
        }
    },
    {
        text  : 'Custom rendering',
        width : 150,
        type  : 'customCheck'
    },
    { text : 'Date', field : 'start', width : 130, type : 'date', format : 'MMMM D YYYY' },

],

data : DataGenerator.generateData({
    count     : 50,
    addSkills : 3
})
});

Adding a guard to the renderer suppresses the error, but results in the checkbox disappearing entirely:

renderer({ widgets }) {
       if (!widgets?.length) {
           return;
       }
       widgets[0].disabled = true;
}

This functionality used to work on version 5.6.2. Please could you fix this regression ASAP or advise if we are doing something wrong!

Thanks.


Post by ghulam.ghous »

Hi there,

I have confirmed this as a regression from 5.6.5 version. It works as expected in 5.6.5. I have created a ticket to fix this issue here https://github.com/bryntum/support/issues/8628. You can subscribe to it to keep track of updates.

Regards,
Ghous


Post by ogardnerffdc »

Thanks Ghous!
Do you have an estimation for when this might be fixed?
This issue is currently blocking us from upgrading.


Post by ghulam.ghous »

Hi there,

This is marked as a regression and high priority. High priority tickets usually gets fixed inside time span of a patch release that is 2 to 3 weeks. Though we do not give you can exact time frame but in best case scenario team will try to fix it before the next patch release.

Regards,
Ghous


Post Reply