Our powerful JS Calendar component


Post by loki »

Hello,

I'm trying to create an event list calendar
When I use a StateProvider and try to resize on of the columns, I get the following error:

Uncaught TypeError: subGrid.header is undefined
    onColumnsResized.                           GridBase.js:1070
    update                                                  ColumnStore.js:409
    trigger                                                   Events.js:907
    onModelChange                                Store.js:780
    afterChange                                       Model.js:1200
    inSet                                                      Model.js:1161
    set                                                         Model.js:1030
    set width                                              Column.js:1685
    onResizing                                           ColumnResize.js:69
    trigger                                                  Events.js:907
    update                                                 ResizeHelper.js:496
    internalMove                                       ResizeHelper.js:413
    onMouseMove                                    ResizeHelper.js:428

I can create a workaround like this:

export class CustomStateProvider extends StateProvider {
    setValue(key: string, value: object): StateProvider {
        if (key.startsWith("my-stateId")) {
            const valueAny = value as any;

            // Storing subGrids will cause 'TypeError: subGrid.header is undefined' when using the StateProvider
            // with <BryntumCalendar />
            delete valueAny.subGrids;
        }

        return super.setValue(key, value);
    }
}

What could be the cause and how could I potentially solve it?

With kind regards, Loki


Post by marcio »

Hello loki,

Could you provide more information regarding your implementation? Are you able to customize one of our demos with your configuration and share it here for us to check?

You can get more info by checking our guidelines here https://www.bryntum.com/forum/viewtopic.php?f=1&t=772

Best regards,
Márcio


Post by Animal »

Seeing as how React is somehow involved in all this, I suspect that subGrid isDestroyed

If you set a debugger breakpoint there is that the case?


Post Reply