Our pure JavaScript Scheduler component


Post by meanking »

This is the code I am using for updating eventStore by date chage.

Last edited by meanking on Mon Feb 22, 2021 8:32 pm, edited 1 time in total.

Post by mats »

Ok this is exactly why you need to post code when requesting help. It seems we have terminology confusion here. For us 'filtering' means using our Filter API. https://bryntum.com/docs/scheduler/#Core/data/mixin/StoreFilter

const filter = () => {

const source = axios.CancelToken.source()

fetchData(source, token, moment(date).format('YYYY-MM-DD'))
setSelected(moment(date).format('YYYY-MM-DD'))
}

It looks like 'filter' in your app means reloading the data store? What does the setSelected method do? Can you please upload a full test case so we can run it ourselves and see what's going on?


Post by meanking »

Ah, I understand what you mean. You thought filtering means your filter api. I can make sense.
I can provide you full code, but not for backend api. That's why I am using local api server.
Is it okay?

setSelected is only for changing date with selected one.

		<Content
                    autoReschedule={autoReschedule}
                    jobs={jobs}
                    date={selected}
                />

It is being used here.

date={selected}

Last edited by meanking on Mon Feb 22, 2021 2:11 pm, edited 1 time in total.

Post by alex.l »

Hi meanking,

I checked your application.
The problem here is not in the bug, but in the not fully correct logic. As I answered before, you will not have 'update' events for particular records in case you reload data from server-side.
Another moment is that if you didn't save local changes, they will disappear after reload and we don't track what exactly is disappeared. If you split your logic and going to work with data on backend and partly on frontend, you should take care on your own to save your changes. As example, copy your changes and save somewhere, compare and apply after reload, I cannot say exactly, because the business logic is still hidden to me.
My suggestion is - if you use backend, please move you logic with data to backend, track adding/removing of your events there and update scheduler and grid with that relevant data.
If you are going to follow your logic, you need to think more how do you want to keep your changes after your store is reloaded.
A store will not trigger "update" events for all your records on data reload, this is by design.

Good luck on that,
Alex

All the best,
Alex


Post by meanking »

Hi Alex,
Thanks, but I don't understand what you want to describe.
Also, I think there is no solution to solve this issue unfortunately.

All the best


Post Reply