Our pure JavaScript Scheduler component


Post by thorthor »

Hello Bryntum team,

This is relevant to this issue that was fixed viewtopic.php?f=44&t=11209&start=10.
eventStore.removeAll(false)
was the fix for replacing the store internally after external update inside a react app, but now we're having problems with events' drag and drop.

Instructions for installation of the reproducible repository:

1. clone repository https://github.com/renatoruk/bryntum-scheduler-react-test
2. create vendor folder in the root directory
3. paste scheduler-vanilla-2.1.1.zip in the vendor directory
4. extract scheduler to that folder
5. run npm install in the project's root directory
6. run "npm run start" after installation


Instructions for bug reproduction:

1. Run the test app (step 6)
2. try to drag and drop any event into a different row (resource) and drop it — the event will disappear
3. zoom in or out to trigger repaint
4. the dropped (disappeared) events will reapper

I recorded a test case on video: https://www.youtube.com/watch?v=S5CK-e9cBi4&feature=youtu.be

Is this a bug or do I need to change something on the scheduler/EventModel to refresh the view?

Cheers,
Renato

Post by pmiklashevich »

Hello @thorthor,

Debugging user applications is a bit out of the forum scope support. I see drag and drop is broken in your application, but it's hard to allocate the problem and I cannot reproduce this issue neither with our simple demos nor with react typescript demos. In 2.1.1 all our wrappers including React wrapper were completely reworked. That with a great chance could fix your issue. In the distributive there is only Basic demo in examples/react/typescript. But in our working branch we already have Filtering demo which shows using filtering feature. It will be a part of next major release. I can zip it up and send it to you. Could you please get it running to make sure drag and drop works there. Then please adjust it the way your current app works and see if drag and drop still works. If not please zip it up and send it back to me, so with the GIT I can reveal what has been changed and what leads to this problem.

Instructions are:
1. Unzip archive to scheduler-2.1.1/examples/react
2. Go to scheduler-2.1.1/examples/react/_shared
3. Run `npm install` and `npm run build`
4. Go to scheduler-2.1.1/examples/react/typescript/filtering
5. Run `npm install` and `npm run start`

Best wishes,
Pavel
Attachments
filtering.zip
(4.08 MiB) Downloaded 154 times

Pavlo Miklashevych
Sr. Frontend Developer


Post by thorthor »

Hello Pavel,

thank you for the help and for the filtering example, I tried implementing the same thing with that new example you provided and I got to the conclusion.

The problem was not in the BryntumScheduler component itself (the react wrapper), but I believe it's something internal in the library.
By constructing extended EventModels I had a custom mapping from an object that contained nested models. What I mean by that you can see on the following example.

I followed docs for EventModel that said that I can map a custom attribute to a field name from EventModel if the passed argument to event model does not have that attribute. That's what I did in the example by mapping bar.id to resourceId, but I think this broke it. I am not sure if this is only relevant to resourceId, but I tried changing computedDateFrom to computed.dateFrom and the problem was not present so maybe it's only for resourceId.

The fix was mapping the model earlier and not transforming fields from other objects inside EventModel.

Now that this problem is fixed, I have another one as the dataset I pass to the scheduler is rather large. I believe it's relevant to another post on this forum. I see the ticket is already opened, can you update me on its progress? This is pretty important for us as the dataset is usually not that big, but already at 100+ entries we have errors: "Cannot read property 'setTop' of undefined".

I've updated the example in the repository: https://github.com/renatoruk/bryntum-scheduler-react-test, but nothing much changed besides changing the event/resource count and the aforementioned fixes.

Best,
Renato

Post by pmiklashevich »

Hello Renato,

With your help I was able to reproduce this issue in our Basic demo. Thanks a lot! Ticket here: https://app.assembla.com/spaces/bryntum/tickets/8794-event-disappears-when-dragged-to-a-different-resource-if-nested-field-mapping/details

About https://app.assembla.com/spaces/bryntum/tickets/8746-drag-and-drop-breaks-row-rendering-when-the-view-is-scrolled-and-drop-make/details I have no specific date to be announced, but it's on our radar. And thanks that you'd searched in our forums and found the ticket before made a report!

Cheers,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by thorthor »

Cool, glad I could help!

Please let me know when you have the fix or an approximate patch release date as this is currently a blocker for a feature we're building.

Best,
Renato

Post by pmiklashevich »

We're planning to get them fixed for the next release (2.1.3). 2.1.2 has just been released. Cheers!

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply