I found a bug when add assignmentStore into ExtjsModern in my develop.
Can you help to find a workround or fix it?
You can test in online ExtjsModern demo with following step(I will use multi assign data in this case):
1. Remove all eventStore and resourceStore,
Open the console,
Ext.first('schedulerpanel').getEventStore().removeAll()
Ext.first('schedulerpanel').getResourceStore().removeAll()
Ext.first('schedulerpanel').setAssignmentStore(new bryntum.scheduler.AssignmentStore())
var res = [
{ id : 'r1', name : 'Celia', city : 'Barcelona' },
{ id : 'r2', name : 'Lee', city : 'London' },
{ id : 'r3', name : 'Macy', city : 'New York' },
{ id : 'r4', name : 'Madison', city : 'Barcelona' },
{ id : 'r5', name : 'Rob', city : 'Rome' },
{ id : 'r6', name : 'Dave', city : 'Barcelona' },
{ id : 'r7', name : 'Dan', city : 'London' },
{ id : 'r8', name : 'George', city : 'New York' },
{ id : 'r9', name : 'Gloria', city : 'Rome' },
{ id : 'r10', name : 'Henrik', city : 'London' }
]
Ext.first('schedulerpanel').getResourceStore().add(res)
var eve = [
{
id : 1,
startDate : new Date(2017, 0, 1, 10),
endDate : new Date(2017, 0, 1, 12),
name : 'Multi assigned',
iconCls : 'b-fa b-fa-users'
},
{
id : 2,
startDate : new Date(2017, 0, 1, 13),
endDate : new Date(2017, 0, 1, 15),
name : 'Single assigned',
iconCls : 'b-fa b-fa-user',
eventColor : 'indigo'
},
{
id : 3,
startDate : new Date(2017, 0, 1, 8),
endDate : new Date(2017, 0, 1, 11),
name : 'Single assigned',
iconCls : 'b-fa b-fa-user',
eventColor : 'cyan'
},
{
id : 4,
startDate : new Date(2017, 0, 1, 10),
endDate : new Date(2017, 0, 1, 13),
name : 'Single assigned',
iconCls : 'b-fa b-fa-user',
eventColor : 'blue'
},
{
id : 5,
startDate : new Date(2017, 0, 1, 13),
endDate : new Date(2017, 0, 1, 15),
name : 'Single assigned',
iconCls : 'b-fa b-fa-user',
eventColor : 'violet'
}
]
Ext.first('schedulerpanel').getEventStore().add(eve)
var ass = [
{ resourceId : 'r1', eventId : 1 },
{ resourceId : 'r2', eventId : 1 },
{ resourceId : 'r8', eventId : 1 },
{ resourceId : 'r3', eventId : 2 },
{ resourceId : 'r4', eventId : 3 },
{ resourceId : 'r5', eventId : 4 },
{ resourceId : 'r6', eventId : 5 }
]
Ext.first('schedulerpanel').getAssignmentStore().add(ass)
6.
Ext.first('schedulerpanel').getEventStore().on('change', (event)=>{
console.log(event)
})
double click an event then you can see a copy of this event. If it is a multi assign, it will copy the first one. Also you can see the console the eventStore changed.
7. drag an event you have already double click, and move to another place, then you will see one of the event will not move
Please help with that.
Many thanks
Edison