I’ve got a custom element that is a datepicker with input fields for day and year and dropdown list for Month. This is used in other components for date input only and the datevalue bound to different elements within the class using it.
I have a requirement to use it in another page to control the search value on a table (we’re using au-table).
Problem: I need to be able to reset the date value. I can do this in the custom datepicker element which will clear the datepicker value via a reset button, but I also need to be able clear the filter value in the parent page using another button.
Is there a way to somehow be able to have both buttons in the parent page, with the reset button calling back to the custom-element view model to clear the model AND clear the datevalue in the parent class? Or is there perhaps a better, more Aurelia-onic way?
au-table with filters object for searching/filtering table
include datepicker and bind datevalue of datepicker VM to local variable in parent class
reset button to clear datepicker value and clear filter on parent class
search button use the value of the datepicker to filter the table