PDA

View Full Version : datepiker color days



iabad
30 Apr 2014, 5:58 AM
Hi, first thanks for all.

I try do an aplication with an calendar (default Ext.menu.datepicker) with my free days.
i see on internet examples as diary, task, etc, but i only need color the background and text.

I have all data on the store, and really I don't have idea how can I do this.

I searching a lot of information but didn't find information about color specific days on docs/api.

thanks, Ivan.

iabad
5 May 2014, 1:54 AM
I found a partial solution. but i need more help.
1- NEW HELP:
I can paint a specific day but I have a problem.
when load the first time, (or click event) haven't problem:
http://www.imglovely.com/imagenes/19/web/6f.jpg

But, when I change month (click an arrow, or change month) don't paint days:

http://www.imglovely.com/imagenes/19/web/71.jpg

how can I solve this?


2- partial soultion,
on Datepicker, each td have information about day on the title, I search this title and add css class.

thanks, Ivan.

umeshatccrn
6 May 2014, 3:16 AM
Hi,

If possible can you please share the code how you highlight the date in calender?

Thanks,
Umesh Kulkarni

iabad
6 May 2014, 6:58 AM
Hi,

If possible can you please share the code how you highlight the date in calender?

Thanks,
Umesh Kulkarni

The code not, because I'm at Home, but I can put the logic.


1- Create a css class (in my case, 'diafestivo') an assign background-color and border.
2- Download JQuery (you can do that with pure JS), but it's very easy with JQuery.
3- on an event, load, click, any:

loop the store, on each:

search by "title" attribute: $("[title='May 06, 2014']") -> (datepicker use attribute title)

before assign class, you need .removeClass('diafestivo');
assign class .addClass('diafestivo');


4- This is all, I think.

umeshatccrn
6 May 2014, 9:37 PM
Hi,

Thanks for your response.You suggested to use jquery but I am bound to use ExtJS 4.2 datefield :(
If you have solution for ExtJS 4.2 calendar then can you please share it with me?

Thanks,
Umesh Kulkarni

iabad
6 May 2014, 11:26 PM
Hi,

Thanks for your response.You suggested to use jquery but I am bound to use ExtJS 4.2 datefield :(
If you have solution for ExtJS 4.2 calendar then can you please share it with me?

Thanks,
Umesh Kulkarni


what is your problen exactly? addclass? find by title?
you can do that without JQuery
you can use pure Javascript
addclass: http://stackoverflow.com/questions/507138/how-do-i-add-a-class-to-a-given-element
search by title: http://www.w3schools.com/jsref/prop_html_title.asp

but maybe need more things


Regards, Ivan.

umeshatccrn
7 May 2014, 4:19 AM
Hi Ivan,

Posted my requirement here http://www.sencha.com/forum/showthread.php?285030
Can you please have a look?

Thanks,
Umesh Kulkarni