nemrutco / nova-global-filter

This package allows you to apply any of your existing Laravel Nova filters to your cards in Dashboards or Index and Detail view of your nova resources.
MIT License
39 stars 32 forks source link

Get initial global-filters into a custom component #6

Closed gassius closed 4 years ago

gassius commented 4 years ago

Hi, thanks for your work in this component

I am trying to make a custom component that wraps nova-chartjs in order to allow filtering from your component. I am able to capture the emmit Event with the changes to the Global Filters and react to them, however, I would need to access the original values from the filters at load. Is there any way I can hook into this data?

MuzafferDede commented 4 years ago

Sorry, i don't get your question well. Do you need to access filter's default values at some point? Maybe a sample code would help me to understand.

gassius commented 4 years ago

Hi @muzafferdede

I have a GlobalFilter state with your component, and with each change, it will emmit a global-filter-changed event with the changed filter

I have another Card (custom component) that use this GlobalFilter state and consumes the global-filter-changed event , However, I would like to know if there is a way to query the whole GlobalFilter state from your component when I load mine.

I hope its clear this time :-)

MuzafferDede commented 4 years ago

@gassius got it, and good news that i released v1.0.4 includes this ability now. Check Readme for details. You can close the issue once you think all good. Thanks for the idea. Cheers

gassius commented 4 years ago

Good! I will try it out, but seems clear on the Readme

Once again, thanks for your work on this.

cord commented 4 years ago

@gassius check out https://github.com/Nova-BI/nova-databoards which maybe solves some of your issues. Would be great if we can join forces to improve this package?