Page 1 of 1

listen to width change on the data columns of left hand side of the scheduler control

Posted: Mon Mar 29, 2021 9:28 pm
by kyunus@bstglobal.com

Hello,
I have 2 questions.
#1. how do I listen to width change on the data columns on the left-hand side of the scheduler control?
#2. how do I dynamically set the width on those data columns?

Thanks in advance


Re: listen to width change on the data columns of left hand side of the scheduler control

Posted: Mon Mar 29, 2021 9:57 pm
by mats

#1. how do I listen to width change on the data columns on the left-hand side of the scheduler control?

Since the columns property is a regular store, you can observe the https://bryntum.com/docs/scheduler/#Core/data/Store#event-update

scheduler.columns.on({
    update : event => console.log(event)
});

#2. how do I dynamically set the width on those data columns?

Simply set the width property: https://bryntum.com/docs/scheduler/#Grid/column/Column#property-width

scheduler.columns.first.width = 200

Re: listen to width change on the data columns of left hand side of the scheduler control

Posted: Tue Mar 30, 2021 5:02 am
by kyunus@bstglobal.com

thanks


Re: listen to width change on the data columns of left hand side of the scheduler control

Posted: Tue Mar 30, 2021 8:27 pm
by kyunus@bstglobal.com

quick question, this events fires rather frequently, how can I get an observable from that event so I can use debounce time operator


Re: listen to width change on the data columns of left hand side of the scheduler control

Posted: Wed Mar 31, 2021 9:58 am
by alex.l

We do not have a delay option for event listeners, but that's a good idea to add it, here is a feature request: https://github.com/bryntum/support/issues/2590
Meanwhile you could use https://bryntum.com/docs/scheduler/#Core/helper/FunctionHelper#function-createBuffered-static function to wrap your event handler:

const delayedHandler = FunctionHelper.createBuffered(eventHandlerFn, 200, thisObj, args);
store.on('update', delayedHandler);

All the best,
Alex


Re: listen to width change on the data columns of left hand side of the scheduler control

Posted: Wed Mar 31, 2021 6:30 pm
by kyunus@bstglobal.com

thanks