AnyPicker
AnyPicker copied to clipboard
How to hook into Set and Cancel functions for the date/time picker?
I see the "inputSetEvent", which fires every time the date changes.
How do I hook into the Set and Cancel button actions?
Right now there is no separate callback function which is called on button click.
Following 4 callback functions can be used to capture show and hide events of the picker.
onBeforeShowPicker- Called before showing AnyPicker View.onShowPicker- Called after showing AnyPicker View.onBeforeHidePicker- Called before hiding AnyPicker View.onHidePicker- Called after hiding AnyPicker View.
I can add that function, but should I add it before or after other code is executed? Do you have any specific requirement? Do you need any specific parameters in buttonClicked.
What I though was to add buttonClicked callback function after other code on that function is executed and function declaration would be buttonClicked(buttonType). Here buttonType can have values - "set", "clear", "cancel" or "now".
Maybe it would be good to have sOutput and oSelectedValues or similar parameters on the onHidePicker too. I'd like to be able to reset the date to it's initial state when user hits "Cancel".
Or maybe it'll be good to have a separate function like resetDate(sOutput, oSelectedValues) or something like that?
Your idea to have a buttonClicked with "set", "clear", "cancel" or "now" sounds good too.
Regards and many thanks for that handy plugin