PDA

View Full Version : Date Picker



zquirm
6 Nov 2006, 12:30 PM
I'd like to use your date picker b/c it seems much more lightweight than YUI's calendar. Can you use that outside of the Grid? If so, how?

thanks.

jack.slocum
6 Nov 2006, 4:44 PM
There are no examples of using it outside of the grid yet. When the forms stuff is finished there will be some examples of using it.

pomata
9 Dec 2006, 5:15 AM
Any Idea when this is going to happen?

ta

Pomata

ciduarte
19 Apr 2007, 7:33 PM
I have already used it outside of a form/grid like this...

datePicker = new Ext.DatePicker();
datePicker.render(Ext.get('calendar'));

alanwilliamson
3 May 2007, 3:14 AM
I got this far also, but i am finding it difficult to find a 'clean' way to have the DatePicker popup above the current elements.

I suspect i need to create a layer dynamically, and then place it inside that particular layer.

Would that be correct?

alanwilliamson
3 May 2007, 3:27 AM
Here is what i hacked together for this:



<div id="datepicker" style="z-index: 9999; position:absolute;"></div>

// calls this function logic:

var divTag = Ext.get('datepicker');
var anchor = Ext.get( 'anchorDiv' );

divTag.setX( anchor.getX() );
divTag.setY( anchor.getY() );

datepicker.render( divTag );
datepicker.show();


This pops up the date picker and allows us to now display near the form in question.

alanwilliamson
3 May 2007, 3:38 AM
Okay now my next problem is closing/cancelling the DatePicker; how can i do this cleanly?

The user has to click a date to close it down, otherwise it stays up forever!

Thoughts?

august
8 Oct 2007, 11:47 PM
Okay now my next problem is closing/cancelling the DatePicker; how can i do this cleanly?

The user has to click a date to close it down, otherwise it stays up forever!

Thoughts?

Anyone answer this question?i also want to use datepicker with my own button and anyone can show me the way? thanks in advance!

abbasali
5 Mar 2008, 3:00 AM
Sorry to bump this thread. I am also facing the same issue of datepicker staying up forever and need a solution to close it down either with a button (on picker itself) or when the user clicks away.

zurik44
8 Mar 2008, 8:35 PM
var datepickeractive = 0;
function selectDate(){
var datepicker = new Ext.DatePicker();
if(datepickeractive == 0){
datepicker.render('dateholder');
datepickeractive=1;
} else {
Ext.get('dateholder').dom.innerHTML='';
datepickeractive=0;
}
}

abbasali
12 Mar 2008, 3:03 AM
I implemented this in the button handler which brings up the date picker



date_picker = = new Ext.DatePicker();
// Button handler function
handler: function() {
if (date_picker.rendered)
{
if (date_picker.isVisible())
{
date_picker.hide();
}
else
{
date_picker.show();
}

}
else
{
date_picker.render('choose_date');
}
}


Though i am still in search for a way to close the date picker when user clicks anywhere on the screen (apart from picker). Above method closes the date picker only if user clicks the button.

ah_fui
16 Mar 2008, 6:38 AM
hi, may i know how to tune back the css for the date picker ??

since it is created at out of the grid...

might be some of the css is no longer can apply into it ...

css bug when choose year or month.

thx