omnia-digital/livewire-calendar

Calendar doesn't display

Closed this issue · 9 comments

Just using the values from the readme, I get no errors, but nothing displays either. Any suggestions on where to start looking?

Did you add the component to a specific view? If you added the component and still get nothing, I would add https://github.com/barryvdh/laravel-debugbar and see if you can figure out what is happening there or check the laravel logs.
image

It's really strange. I'm getting the exact same thing.

There are no errors, and nothing reported in Telescope. The livewireScripts and livewireCalendarScripts are included fine.

It seems like its an issue that has occurred for other users before:

Here:
asantibanez/livewire-calendar#31

And here:
#12

I just can't figure it out at all.

@Critter did you manage to find a solution?

oh you're right, thanks for reminding me of that. So it looks like in that instance he made a child component of LivewireCalendar and then never called the parent::render(). So you can render your own child component in 2 ways:

  • set the $this->calendarView to your view component and then call parent::render()
  • override the render() method and make sure to include all of the parameters.
    image

Let me know if that helps

@joshtorres I'm still quite new to Laravel, and still not able to suss it out. If I use the code above, I throw an error:

Property [$id] not found on component: [appointments-calendar]

on 'componentId' => $this->id,

@Critter ok thanks for pointing that out. It looks like the new version of livewire is using a different way of retrieving the component Id. I just updated the LivewireCalendar component so now it should work with either version of livewire.
Note: you will need to run composer update to get the new version of the package.
Also, you don't have to have the render() method at all in your child AppointmentsCalendar component.
It could look similar to this:
image

@joshtorres perfect! that did it. I appreciate you taking the time to explain it.

/cc @ndynamite this sorted it.

No problem @Critter . I'm glad I could help :D

@joshtorres Dude. that debug bar is some shit! Thanks for that also. 🙏🏻

No problem! Yeah Debugbar is amazing!