Our pure JavaScript Scheduler component


Post by thomasb »

Hi there

I have a question regarding the resource collapse functionality, regarding to this sample:
https://www.bryntum.com/examples/scheduler/resource-collapsing/

Is there a simple way to show the collapsible icon only if there are is at least one event available?
So in this example the icon would been hidden for "Lee" and "Jong".

Thanks in advance for your help.

Best,
Thomas


Post by tasnim »

Yeah, Sure. To do so, you can use the renderer function
https://bryntum.com/docs/scheduler/api/Grid/column/Column#config-renderer

        { type : 'resourceCollapse', renderer({ record }) {
            if (record.events.length > 0) {
                return {
                    tag   : 'i',
                    class : {
                        'b-icon'                 : 1,
                        'b-icon-expand-resource' : 1,
                        'b-flip'                 : record.eventLayout !== 'none'
                    }
                }
            }
        } }

Good Luck :),
Tasnim

Attachments
Screenshot 2022-10-07 154445.png
Screenshot 2022-10-07 154445.png (75.25 KiB) Viewed 147 times

Post by thomasb »

perfect, thanks!


Post Reply