Datepicker on change

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Datepicker on change

Post by pfrumkin » 2020-07-24 22:46

Hi,

I have a DateTime column, I want to use JS to catch when the value changes and make an AJAX call. AG makes the DateTime a datepicker and in doing so, breaks the on change code I had (I had originally had as a Date field).

Anyone know how to catch changes on datepickers? I googled and ran into dead ends, hoping someone has done this in AG world.

Thanks.

~Paul

AppGini 5.83

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Datepicker on change

Post by pbottcher » 2020-07-27 09:09

Hi,

try

$j('.datetimepicker').on('dp.change',.....)
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

pfrumkin
Veteran Member
Posts: 157
Joined: 2020-02-18 17:58
Location: Albuquerque, New Mexico USA

Re: Datepicker on change

Post by pfrumkin » 2020-07-27 19:14

Thanks! That is certainly the on change event - funny how my google searches didn't take me there.

Slight tweak (groan), I couldn't get it to fire as is, I found after googling that the event fires on change of the div, not the actual control. I will experiment with the _dv hook to tweak the html but for now I have to hardcode the _dv.html template. See https://github.com/Eonasdan/bootstrap-d ... ssues/1940. Looks like an incompatibility between JQuery and the datepicker lib.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Datepicker on change

Post by pbottcher » 2020-07-27 19:52

Hi,

just go for the the active select2 and the current selected element. That gives you what you need.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply