dcasia / column-toggler

A Laravel Nova package that allows you to hide/show columns in the index view.
MIT License
45 stars 5 forks source link

Toggle menu doesn't appears #11

Closed scramatte closed 1 year ago

scramatte commented 1 year ago

Hi,

I've just installed your component but toggle menu doesn't appears on the index view Any idea of what occurs?

I've got similar issue with your expandable row component

Regards

milewski commented 1 year ago

It is mostly likely you are using another package that overrides native nova components instead of extending it, can you post your composer json so I can point out which package is the offending one.

scramatte commented 1 year ago

Hi,

Thank you to reply.

I've been able to get working column toggler. It's looks that the problem was with datomatic/nova-detached-actions package.

I've removed it as you have got some similar package to achieve same job.

milewski commented 1 year ago

Okay, it's unfortunate that many packages out there completely replaces the nova components.. There is a way to extend but maybe people are just not very good at vue

majdcodes commented 1 year ago

@milewski can you please share this way? thanks

milewski commented 1 year ago

Take a look at how I implemented it in this package: https://github.com/dcasia/column-toggler/blob/2e4e3e0720083e9fdf3c62b45259f63d00807dcd/resources/js/tool.js#L54-L59

Instead of completely overriding the toolbar, I wait for it to be mounted, and then manually render a new vnode exactly where I want. This way, I dont have to override the original toolbar, and any changes the Nova team makes to it won't affect this package.