Our pure JavaScript Scheduler component


Post by doonamis »

Hello,

I would like to update the info on the event currrenlty being draged depending on the resource currently is

I've been able to do so on eventDrop calling the method "refreshRows()" on the source but I don't know if there is a method to only refresh the current event on drag to avoid refreshing all rows all the time

Thanks!

Post by pmiklashevich »

Updating event element while dragging is not supported. You can only update the tooltip out of the box: https://www.bryntum.com/docs/scheduler/#Scheduler/feature/EventDrag#config-dragTipTemplate

Also you don't need to call "refreshRows" to update events on drop. Please use eventRenderer for that:
https://www.bryntum.com/docs/scheduler/#Scheduler/view/mixin/SchedulerEventRendering#config-eventRenderer
new Scheduler({
    eventRenderer : ({ eventRecord, resourceRecord }) => `${eventRecord.name} (${resourceRecord.name})`,

Pavlo Miklashevych
Sr. Frontend Developer


Post by doonamis »

Hello pmiklashevich

Thanks, I'm already using eventRenderer, the thing is to update the event I'm doing an async api call than updates a variable from that event, so once is drop, the eventRenderer the event get's refreshed but once the api call is done I would need to refresh it again, that's why I'm calling refreshRows

Post by pmiklashevich »

When your ajax call is done you can write to an event field. Changing event data will automatically update it on the screen.
You can try here: https://bryntum.com/examples/scheduler/basic/
scheduler.eventStore.first.name = 'test'
See the first record is renamed.
If you need a custom field for your remote data, feel free to provide it: https://www.bryntum.com/docs/scheduler/#Common/data/Model
class Person extends Model {
    static get fields() {
        return [
            'name',
            { name : 'birthday', type : 'date', dateFormat : 'YYYY-MM-DD' },
            { name : 'shoeSize', type : 'number', defaultValue : 11 },
            { name : 'age', readOnly : true }
        ];
    }
}

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply