Date Widget
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Date Widget
Is there a way to show/bring up the calendar in a date widget when a button is clicked?
- Alex
- Profound Logic Staff Member
- Posts: 233
- Joined: Fri Jan 04, 2008 12:10 pm
- First Name: Alex
- Last Name: Roytman
- Company Name: Profound Logic Software
- Contact:
Re: Date Widget
In the current release, you can attach the following to the button's onclick event:
Where "Date1" is the id of the date widget.
In the next release, we will publish a more formal API to accomplish this. It will be called pui.showCalendar().
Code: Select all
getObj("Date1").calimg.click()
In the next release, we will publish a more formal API to accomplish this. It will be called pui.showCalendar().
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Date Widget
Hi Alex,
I placed the "pui.showCalendar("DateID")" method in the onClick of a button, with the ID of a date widget as its parameter, but it didn't work. When I click on the button nothing happens.
I'm using the latest release of profoundui (4.1.6).
I placed the "pui.showCalendar("DateID")" method in the onClick of a button, with the ID of a date widget as its parameter, but it didn't work. When I click on the button nothing happens.
I'm using the latest release of profoundui (4.1.6).
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Date Widget
Hi could I have some help. I tried: pui.showCalendar("DateID") and it isn't working. I have it in the onclick of a button. when I click the button, nothing happens.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Date Widget
Does it work if you use the older method -- getObj("Date1").calimg.click()?
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Date Widget
Hi, "getObj("Date1").calimg.click()" didn't work either.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Date Widget
I've noticed that you can work around this problem by changing your onclick to this:
Does that work for you?
I'm not sure if that's a "good" way to make it work, but it seems to work for me. I will have to check with colleagues and see what they think.
Code: Select all
setTimeout( function() { pui.showCalendar("Date1"); }, 0 );
I'm not sure if that's a "good" way to make it work, but it seems to work for me. I will have to check with colleagues and see what they think.
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Date Widget
Hi scott, that method is working for me in the browser, but it isn't working in my mobile tablet or phone. I am using the profound ui mobile client.
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Date Widget
I still can't get "pui.showCalendar("Date1")" to work in the mobile client. help
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Date Widget
The original problem occurs because of the way the calendar popup works. When the calendar comes up, you can "click away" (click any area outside of the calendar popup) to close it.
The problem is that when you put a button on the screen that opens the calendar, you start by clicking the button. The first thing your click does is open the calendar box, but then the calendar box sees you clicking outside of the popup (because you're in the middle of a "click" event on the button) and immediately closes the popup.
The setTimeout() worked around this problem by adding a slight delay to opening the popup, so that it occurs after the button click is complete.
Not sure why this wouldn't also work in the mobile client, though. You could try preventing the default action for the click to the button and see if that helps?
The problem is that when you put a button on the screen that opens the calendar, you start by clicking the button. The first thing your click does is open the calendar box, but then the calendar box sees you clicking outside of the popup (because you're in the middle of a "click" event on the button) and immediately closes the popup.
The setTimeout() worked around this problem by adding a slight delay to opening the popup, so that it occurs after the button click is complete.
Not sure why this wouldn't also work in the mobile client, though. You could try preventing the default action for the click to the button and see if that helps?
Who is online
Users browsing this forum: No registered users and 3 guests