gismofx / toast_ui.blazor_calendar

Toast UI Calendar Wrapper For Blazor
MIT License
54 stars 8 forks source link

Week and Day View not working #47

Closed armendimeri closed 2 years ago

armendimeri commented 2 years ago

Following error is thrown in console when trying to switch views: I managed to get the calendar running with help from the test project though mismatching versions between it and the release did cause some issues with some functions not having return types.

Though for some reason the calendar is only working in month view and when trying to switch via the same commands as in the test projects I get the following error.

Note that i copied the CalendarViewModel and its base into my project but filled it with my own data instead of using Bogus.

Uncaught TypeError: Cannot read properties of null (reading '0')
    at d.<anonymous> (tui-calendar.js:26869:22)
    at tui-code-snippet.js:1062:36
    at r (tui-code-snippet.js:947:23)
    at a (tui-code-snippet.js:1024:10)
    at Object.s [as map] (tui-code-snippet.js:1061:6)
    at d._getBaseViewModel (tui-calendar.js:26858:22)
    at d.render (tui-calendar.js:26887:25)
    at c.<anonymous> (tui-calendar.js:28232:19)
    at l (tui-code-snippet.js:984:27)
    at c.each (tui-calendar.js:4144:5)

tui-calendar.js:26869 Uncaught TypeError: Cannot read properties of null (reading '3')
    at d.<anonymous> (tui-calendar.js:26869:22)
    at tui-code-snippet.js:1062:36
    at r (tui-code-snippet.js:947:23)
    at a (tui-code-snippet.js:1024:10)
    at Object.s [as map] (tui-code-snippet.js:1061:6)
    at d._getBaseViewModel (tui-calendar.js:26858:22)
    at d.render (tui-calendar.js:26887:25)
    at c.<anonymous> (tui-calendar.js:28232:19)
    at l (tui-code-snippet.js:984:27)
    at c.each (tui-calendar.js:4144:5)
gismofx commented 2 years ago

Which nuget are you using? Could you zip up your project or one that reproduces the issue and I can take a look?

armendimeri commented 2 years ago

im using beta3.1 which was the latest on the nuget link. Sadly i can't zip up the project to send. Side note: can we customize the edit window of the calendar to add our own fields?

gismofx commented 2 years ago

Could you make a minimal reproducible version?

Try this version in your project: 1.0.0-beta1.1.59

Re customizing: you would have to make your own popup/edit window and capture the on-click event and handle it accordingly. Let me know if you need more info.

armendimeri commented 2 years ago

The version you linked is working fine. Thank you for the help. What event am I grabbing, because in my case I would my custom modal to show instead of the built in one. Or extend the existing one.

gismofx commented 2 years ago

Great!

You need to hook into this eventcallback https://github.com/gismofx/toast_ui.blazor_calendar/blob/0becb313a3a628223b25774b06ed8564611f7d86/toast_ui.blazor_calendar/TUICalendar.razor.cs#L87

armendimeri commented 2 years ago

@gismofx that worked like a charm. I have one more question, there is a functionality for creating events in toast ui where you click and drag on the calendar and it auto fills your dates/times based on your initial selection via clickind and dragging. I can't seem to find an event to hook into this for when creating new events/appointments. Am I missing something? The oncreatecalendareventortask is only called after clicking save on its own form which I dont want to use

gismofx commented 2 years ago

@armendimeri can you send/share a link to the docs TUI docs where it shows that capability/event? I'm sure I can implement it.

I'm going to close this issue, so please open a new issue with this feature addition.