Datepicker on multiple fields

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
eagle
Veteran Member
Posts: 39
Joined: 2013-01-09 15:38

Datepicker on multiple fields

Post by eagle » 2021-01-26 14:20

I have trouble using the datepicker setting on several fiels.

Should this work?

Code: Select all

var dv = new AppGiniDetailView();
dv.compact();
new AppGiniField( "date_a" ).toDatepicker();
new AppGiniField( "date_b" ).toDatepicker();
new AppGiniField( "date_c" ).toDatepicker();

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Datepicker on multiple fields

Post by jsetzer » 2021-01-26 14:25

Did you model those three fields as DateTime, (not Date)?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

eagle
Veteran Member
Posts: 39
Joined: 2013-01-09 15:38

Re: Datepicker on multiple fields

Post by eagle » 2021-01-26 14:30

jsetzer wrote:
2021-01-26 14:25
Did you model those three fields as DateTime, (not Date)?
Yes, all three are DateTime in AppGini and I just checked that they are also datatime in the database.

Only the first field works as intended.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Datepicker on multiple fields

Post by jsetzer » 2021-01-26 14:32

I've just checked and it works for me:

AppGini_bCqo6wcgfq.png
AppGini_bCqo6wcgfq.png (71.88 KiB) Viewed 2414 times

Code: Select all

// file: hooks/TABLENAME-dv.js
var dv = AppGiniHelper.dv;
dv.getField("datetime").toDatePicker();
chrome_KiyCURGS5p.png
chrome_KiyCURGS5p.png (17.57 KiB) Viewed 2414 times

Browser cache problem?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

eagle
Veteran Member
Posts: 39
Joined: 2013-01-09 15:38

Re: Datepicker on multiple fields

Post by eagle » 2021-01-26 14:36

> Browser cache problem?

Yes I think it was. While you wrote this last message I tested once more and now it works. Sorry for the false alarm.

Works great now. Thanks!

Eagle

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Datepicker on multiple fields

Post by jsetzer » 2021-01-26 14:36

By the way:
Please always use the singleton initialization for dv now.

Code: Select all

var dv = AppGiniHelper.dv;
// ...
The old initialization is deprecated since October last year due to problems when developers initialized the same object multiple times at different places, for example in header-extras.php AND again in -dv.js
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Datepicker on multiple fields

Post by jsetzer » 2021-01-26 14:37

No prob. I'm glad it works for you now! Always remember to clear browser cache after changing js or css, especially if there is something does not work as expected.

See troubleshooting guide here:
https://appgini.bizzworxx.de/support/troubleshooting/
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

eagle
Veteran Member
Posts: 39
Joined: 2013-01-09 15:38

Re: Datepicker on multiple fields

Post by eagle » 2021-01-26 15:01

Thanks again!

Will use the singleton initialization for dv from now on :)

Eagle.

Post Reply