Page 1 of 1

Datepicker on change

Posted: 2020-07-24 22:46
by pfrumkin
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

Re: Datepicker on change

Posted: 2020-07-27 09:09
by pbottcher
Hi,

try

$j('.datetimepicker').on('dp.change',.....)

Re: Datepicker on change

Posted: 2020-07-27 19:14
by pfrumkin
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.

Re: Datepicker on change

Posted: 2020-07-27 19:52
by pbottcher
Hi,

just go for the the active select2 and the current selected element. That gives you what you need.