Hi bryntum .
In my project .I want to get the Eventdata of the new time period from the back end after the user clicks the dates switch button .But the dateRangeChange trigger twice when I initialized the data through "calendar.project.loadInlineData()" .
Moreover, when I switch modes, “dateRangeChange” will be triggered twice agian.
What I expect is that “dateRangeChange” will only be triggered when the user clicks the dates switch button.
Is there something wrong, or is there a problem with my logic?
When you switch modes, the date range that is required to show the events in the UI changes.
For example from one week to one month. A new range of dates is needed.
So you react to that and do loadInlineData.
Loading data triggers a UI refresh.
A UI refresh requests a block of events from the store for the range it covers. If the range requested is different from last time, the event will be triggered again.
Are the date ranges the same? I would think they would be, but maybe not.
Because the EventStore has checks to not fire the event if the same date range has been requested:
const
newDateRange = {
startDate,
endDate
},
dateRangeChange = !lastDateRange || (lastDateRange.startDate - newDateRange.startDate || lastDateRange.endDate - newDateRange.endDate);
if (dateRangeChange) {
// Ensure the listeners are present
me.processConfiguredListeners();
/**
* Fired when a range of events is requested from the {@link #function-getEvents} method.
* @event loadDateRange
* @param {Scheduler.data.EventStore} source This EventStore
* @param {Object} old The old date range
* @param {Date} old.startDate the old start date.
* @param {Date} old.endDate the old end date.
* @param {Object} new The new date range
* @param {Date} new.startDate the new start date.
* @param {Date} new.endDate the new end date.
*/
me.trigger('loadDateRange', {
old : lastDateRange || {},
new : Object.assign({}, newDateRange)
});
me.lastDateRange = newDateRange;
}
Hi Animal.
I can understand what you said, but the problem I'm facing now is that the "dateRangeChange" trigger twice after project.loadInlineData . In the p1,You can see that when the "dateRangechange"is triggered for the second time, the StartDate and endDate of new become the starting point of the timestamp in 1970.
when i switch mode ,the "dateRangeChange" triggered twice again . What puzzles me more is that The old and new of the parameters of them are exactly the opposite. As shown in p2
Hi bryntum team.
Can you tell me when the new version(4.3.3) will be released?? Our project is about to go online. If possible, I hope you will release new version as soon as possible . thanks