Closed marciogurka closed 4 months ago
Pure JS test case (needs to run with the backend):
export class MyEventModel extends EventModel {
static get fields() {
return [
{ name : 'modifiedAt', type : 'date', defaultValue : new Date() }
];
}
getModifiedAt() {
return this.get('modifiedAt');
}
setModifiedAt(value) {
this.set('modifiedAt', value);
}
}
const scheduler = new SchedulerPro({
appendTo : 'container',
columns : [
{ text : 'Name', field : 'name', width : 130 }
],
eventStore : {
autoLoad : true,
autoCommit : true,
readUrl : 'http://localhost:5031/bryntum/event',
createUrl : 'http://localhost:5031/bryntum/event',
updateUrl : 'http://localhost:5031/bryntum/event',
deleteUrl : 'http://localhost:5031/bryntum/event',
useRestfulMethods : true,
singleAssignment : true,
//writeAllFields: true,
modelClass : MyEventModel
},
resourceStore : {
autoLoad : true,
readUrl : 'http://localhost:5031/bryntum/resource'
},
listeners : {
beforeEventEdit : (data) => {
console.log(`createEvent`, data);
const er = data.eventRecord;
er.isCreating = false;
er.set({ name : 'Created' });
return false;
}
}
});
Forum post
"Since scheduler 5.6.7 the Scheduler Pro zooms into a week where the first event is created. This was not the case in 5.6.6. This new behavior is not documented in 5.6.7 change log, is this expected? How can I prevent it?
GIF and code attached "
package.zip
Running the project (both backend and frontend at the same time) and creating a new event from zero will trigger the behavior that is presented in the GIF.
Regarding this case, if you set a start date for the scheduler, like this
The behavior won't happen, it only occurs when there are no events created, and no start date set to the scheduler.