Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Open Calender with y,m,d

Questions related to using nuBuilder Forte.
Locked
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Open Calender with y,m,d

Unread post by toms »

Hi,

There is a function

Code: Select all

function nuPopupCalendar(pThis)
and

Code: Select all

function nuPopulateCalendar(id, y, m, d)
Is it possible to kind of combine these two functions so I can pass y, m, d and specify the target (element/field)?

How about adding some additional, optional parameters y, m, d to the nuPopupCalendar(pThis) function?

Code: Select all

function nuPopupCalendar(pThis, y, m, d)
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Open Calender with y,m,d

Unread post by admin »

toms,

I don't quite get what you are saying.

Can you explain what you are trying to do?

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Open Calender with y,m,d

Unread post by toms »

In a subform grid, dates can be entered (using the calender popup)
As you see on the screenshot, 2018-07-19 has been picked in the first row/cell. When clicking the next row, the calender pops up again with the current month (Febrary 2018).
Since I will choose a later date than 2018-07-19, I need to navigate through all the months again to get to the desired date. And so on and so forth...

My idea was to intercept the onclick event that calls nuPopupCalendar(this) and pass a custom date to the calender.
To do so, I would need a function nuPopupCalendar(this,y,m,d) that takes (optional)/additional parameters (year/month/date) to open the calender in another date than today.

I hope it's more or less clear what I want to do...
calendar.PNG
You do not have the required permissions to view the files attached to this post.
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Open Calender with y,m,d

Unread post by toms »

I got It working by adding an additional parameter d (date) to the function nuPopupCalendar();
This allows me to pass a custom date to the function. E,g, nuPopupCalendar(this,'2018-10-07';)
nuPopupCalendar_Param_d.png
Feel free to add it to github.
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Open Calender with y,m,d

Unread post by admin »

toms,

That is now on Github.

Please test it.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Open Calender with y,m,d

Unread post by toms »

Steven,

It works as expected, thanks!
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Open Calender with y,m,d

Unread post by admin »

.
Locked