Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar doesn't display #16

Closed
Critter opened this issue Feb 3, 2024 · 9 comments
Closed

Calendar doesn't display #16

Critter opened this issue Feb 3, 2024 · 9 comments

Comments

@Critter
Copy link

Critter commented Feb 3, 2024

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

@joshtorres
Copy link
Member

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

@ndynamite
Copy link

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?

@joshtorres
Copy link
Member

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

@Critter
Copy link
Author

Critter commented Feb 7, 2024

@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,

@joshtorres
Copy link
Member

joshtorres commented Feb 7, 2024

@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

@Critter
Copy link
Author

Critter commented Feb 7, 2024

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

/cc @ndynamite this sorted it.

@Critter Critter closed this as completed Feb 7, 2024
@joshtorres
Copy link
Member

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

@Critter
Copy link
Author

Critter commented Feb 8, 2024

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

@joshtorres
Copy link
Member

No problem! Yeah Debugbar is amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants