PDA

View Full Version : datepicker selection



paserrano
13 Jan 2010, 4:12 AM
Hi to all

I would like to get a date picker (or month view, the component it doesn't matter) that allows me to select a set of days in it.

For example, I create a date picker (of month view, like I said before) with the current month has the days 13 and 14 with a style differente (like a personal calendar where you can mark birthdays).

I tried with datepicker and the next sentence:

datePickerExample.setValue(new Date());

but only allows me select one day.

I know that in gwt there is a sentence that allows mark a lot of days with an style different:

datePickerGWT.addStyleToDates("dateStyle", dates);

but in ext-gwt I don't find any similar.

Any suggestions?

thanks a lot

VadimV1144
13 Jan 2010, 10:14 AM
Unfortunately the multi selection is not supported by the GXT date picker. Every time you select the value it recalculates the whole grid (I assume this is done so that you can set any arbitrary date).
So if you want that functionality you have to implement it yourself :( .
On the bright side, the DatePicker code is pretty straightforward and easy to modify.

Love Yao
13 Jan 2010, 11:21 PM
I agree. the DatePicker code is easy to modify.
I have successfully made the DatePicker to disable some days from the data in my database.

Arno.Nyhm
15 Jan 2010, 10:12 AM
hi,

can you pls post your changed DatePicker? it would be nice if you share your solution :-)

PS:
maybe you can place this new class also in the "GXT: User Extensions and Plugins" category:
http://www.extjs.com/forum/forumdisplay.php?f=44

VadimV1144
15 Jan 2010, 1:54 PM
sure, I'll clean it up and post it. :)

Love Yao
17 Jan 2010, 7:20 PM
first u can read the method onRender()
in onRender() there being a method update()------it is core!

update() draw the table
and in update() it ues setCellStyle() to make every cell the CssStyle and textVaule.

so just to change the code setCellStyle() will be useful!