VAT calculation
Hello,
I woud like to make two field reactive but on client side.
On an application I'm moving to Filament v3, I need to have two fields:
When the user fill the field
This was done in javscript in the legacy application. I needs to replicate that. Using the
Could I replicate this in javascript/AlpinJs) on my Resource Form? I first though that ViewField could helps but I need a global alipine js component to hold the logic that interracts with several fields.
Do you have some ideas? Thanks in advance!
I woud like to make two field reactive but on client side.
On an application I'm moving to Filament v3, I need to have two fields:
price_excl_vatand price_incl_vat . I agree that is not the bast way to store the information as there is a field vat_rate.When the user fill the field
price_excl_vat the other field should be calculated based on the vat_rate, and if the user types into the price_incl_vat field, it should also calculate the exclusive vat price.This was done in javscript in the legacy application. I needs to replicate that. Using the
->live()->afterStateUpdated() method don't seems to works, if the connection is slow you miss some typed characters.Could I replicate this in javascript/AlpinJs) on my Resource Form? I first though that ViewField could helps but I need a global alipine js component to hold the logic that interracts with several fields.
Do you have some ideas? Thanks in advance!
Solution
Do you have debugmode enabled? That's why it'll be super slow. But also do:
->live()
->lazy()
->afterStateUpdated()
it'll slow down the network requests for when finished basically
->live()
->lazy()
->afterStateUpdated()
it'll slow down the network requests for when finished basically
