Premium support for our pure JavaScript UI components


Post 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


Post 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

Post by kyunus@bstglobal.com »

thanks


Post 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


Post 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

All the best,
Alex


Post by kyunus@bstglobal.com »

thanks


Post Reply