Our pure JavaScript Scheduler component


Post by frederick45 »

Hi,

to update event in salesforce, i use this :
        this.scheduler.eventStore.on({
            update  : this.onEventUpdate,
            //add     : this.onEventAdd,
            //remove  : this.onEventRemove,
            thisObj : this
        });

i want to know how to manage drag and drop in my scheduler
BR


Post by mats »

Can you please elaborate on what you mean by

how to manage drag and drop

Do you mean validation? This demo shows this: https://bryntum.com/products/scheduler/examples/validation


Post by frederick45 »

i want to drag and drop an event, and save it in Salesforce


Post by Maxim Gorkovsky »

When you move an event in a schedule it gets new start/end values - i.e. field changes. And changes in fields are passed in the update event on the store. So, update listener should do the job.


Post by frederick45 »

hi,

when i modify date or ressourceId, it's working, but it's does'nt perform the update event when i drag and drop the event.I don't see the trace console log

        this.scheduler.eventStore.on({
            update  : this.onEventUpdate,
            thisObj : this
        });


************************************************

onEventUpdate(data) 
{
    let record = data.record;
    let changes = data.changes;

    console.log('onEventUpdate');

    //event's employee is update => delete event and create new
    if(JSON.stringify(changes).includes('resourceId'))
    {
        //delete event
        this.deleteEventJS(record.id, JSON.stringify(changes));
        //insert event
        this.insertEventJS(record.id, JSON.stringify(changes));
    }
    else //data update except employee
    {
        this.updateEventJS(record.id, JSON.stringify(changes));
    }
}









Post by alex.l »

All the best,
Alex


Post by frederick45 »

it does'nt work


Post by mats »

If you only move to a new resource you may also want to listen for 'change' on the assignmentStore


Post by frederick45 »

do you have a code example to integrate it ?


Post by frederick45 »

i do this :

            assignmentStore: new bryntum.scheduler.AssignmentStore({
                data: this.ListEvent,
                listeners: {
                    change: () => {console.log('change assignmentStore'); }
                }
            }),

no log, it's KO.
each time i do a drag and drop, i have this log from google developper console
[Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952


Post Reply