« Return to Thread: Using a JSCalendar as a Date Picker [Code Snippet]

RE: Using a JSCalendar as a Date Picker [Code Snippet]

by Jason Priebe :: Rate this Message:

Reply to Author | View in Thread

As a follow-up, you have to do a little more work if your text field
and image objects are not visible on screen when window.application.post
fires (for example, if the widgets are on a non-active page of a
QxBarView).

To handle this, add an event listener to imgCal so that when it first
appears, you can set up the calendar, like this:

window.application.main = function()
{
   // rest of init code deleted...

  imgCal.addEventListener("appear", on_imgCal_appear);

   // rest of init code deleted...
}

// use a variable to ensure that you only initialize the
// calendar once
var calendar_init = false;
function on_imgCal_appear (e)
{
    if (calendar_init)
    {
        return;
    }

    Calendar.setup({
            inputField    : "f_date_b",  // id of the input field
            ifFormat    : "%m/%d/%Y %I:%M %p",    // format of the input
field
            showsTime    : true,   // will display a time selector
            button    : "f_trigger_b",  // trigger for the calendar
(button ID)
            singleClick    : false,   // double-click mode
            step    : 1   // show all years in drop-down boxes (instead
of every other year as default)
    });

    calendar_init = true;
}

> -----Original Message-----
> From: qooxdoo-devel-admin@...
> [mailto:qooxdoo-devel-admin@...] On Behalf
> Of Hugh Gibson
> Sent: Thursday, March 02, 2006 2:53 AM
> To: qooxdoo-devel@...
> Subject: Re: [qooxdoo-devel] Using a JSCalendar as a Date
> Picker [Code Snippet]
>
> > I thought I'd post my achievement in getting JSCalendar
> working within
> > Qooxdoo.
>
> Posted at
> http://qooxdoo.oss.schlund.de/snippets/integrating-jscalendar
>
> Thanks very much! Keep them coming...
>
> Hugh
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking
> scripting language that extends applications into web and
> mobile media. Attend the live webcast and join the prime
> developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&
> dat=121642
> _______________________________________________
> Qooxdoo-devel mailing list
> Qooxdoo-devel@...
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Qooxdoo-devel mailing list
Qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

 « Return to Thread: Using a JSCalendar as a Date Picker [Code Snippet]