Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer of CheckColumn subclass does not have widgets param #8628

Closed
ghulamghousdev opened this issue Feb 19, 2024 · 1 comment
Closed

Renderer of CheckColumn subclass does not have widgets param #8628

ghulamghousdev opened this issue Feb 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed large-account Reported by large customer OEM OEM customer premium regression Worked previously, now broken resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@ghulamghousdev
Copy link
Member

It worked fine in a 5.6.5 but it does not work in 5.6.6.

Forum post

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
})
});
@ghulamghousdev ghulamghousdev added bug Something isn't working regression Worked previously, now broken premium forum Issues from forum large-account Reported by large customer OEM OEM customer labels Feb 19, 2024
@ghulamghousdev ghulamghousdev changed the title Renderer of ExtendedColumn from CheckColumn does not have widgets param Renderer of ExtendedColumn from CheckColumn does not have widgets param Feb 19, 2024
@ghulamghousdev ghulamghousdev added the high-priority Urgent to have fixed label Feb 20, 2024
@ExtAnimal
Copy link

This change broke it: https://github.com/bryntum/bryntum-suite/pull/8610/files#diff-456d5e452e3556323274889ba481b703396766616ec7ce7b0d8e9b3ff657d742L168

@isglass can you remember why it went from

me.renderer = me.internalRenderer;

to

me.setData('renderer', me.internalRenderer);

?

@ExtAnimal ExtAnimal self-assigned this Feb 21, 2024
@ExtAnimal ExtAnimal changed the title Renderer of ExtendedColumn from CheckColumn does not have widgets param Renderer of CheckColumn subclass does not have widgets param Feb 21, 2024
@ExtAnimal ExtAnimal added the ready for review Issue is fixed, the pull request is being reviewed label Feb 21, 2024
@ExtAnimal ExtAnimal added this to the 5.6.8 milestone Feb 21, 2024
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum high-priority Urgent to have fixed large-account Reported by large customer OEM OEM customer premium regression Worked previously, now broken resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

3 participants