1. #1
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382
    Vote Rating
    0
    Elijah is on a distinguished road

      0  

    Question How do I set the background of a day in the datepicker?

    How do I set the background of a day in the datepicker?


    I need to use the datepicker with color coded days to reflect information is present for that day. Can someone point me to an example anywhere so I can see how to do this?

    I need to I am assuming to properly display the datePicker I must
    1. Have my data from an AJAX with information on days that have information.
    2. Prior to rendering of the datePicker tell it what days to shade in a different color

    #1 I have its #2 that I don't know what to do yet.
    How do I tell the datePicker to highlight lets say days of the month 5, 6, 13?
    How do I tell it to make those days have a background color of blue?
    Can I disable clicking on the other days that I do not have a background color on?

  2. #2
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382
    Vote Rating
    0
    Elijah is on a distinguished road

      0  

    Default


    still trying to get this working.

  3. #3
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382
    Vote Rating
    0
    Elijah is on a distinguished road

      0  

    Default


    anyone?

  4. #4
    Ext JS Premium Member Elijah's Avatar
    Join Date
    Nov 2009
    Location
    USA
    Posts
    382
    Vote Rating
    0
    Elijah is on a distinguished road

      0  

    Default


    anyone?

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    58
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Have you been in suspended animation? What steps have you taken to TRY to work this?

    I'd play with DomQuery on the Firebug command line for a minute or so...

    Code:
    Ext.get("my-datepicker-id").child("td.x-date-active:contains(5)").dom
    Gets the 5th.

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    58
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

  7. #7
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    37
    Vote Rating
    0
    jlawton is on a distinguished road

      0  

    Default


    It actually gets the 5th, 15th, and 25th. But you're pointing in the right direction. Thanks!

  8. #8
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    37
    Vote Rating
    0
    jlawton is on a distinguished road

      0  

    Default


    I got it to work with code like this. It's messy, but it'll do for now.

    Code:
    Ext.get(Ext.get('mydatepicker').query('td.x-datepicker-active[title*="15,"]')[0].id).addCls("mynewclass")

  9. #9

  10. #10
    Sencha Premium Member
    Join Date
    Sep 2012
    Posts
    37
    Vote Rating
    0
    jlawton is on a distinguished road

      0  

    Default


    DatePickerPlus is overkill, and I don't want too many 3rd party things in my codebase. I got it to work, I should post what I did here so others might find it useful.

Similar Threads

  1. DatePicker in DateField returns one day less than selected
    By Carlos Ijelchuk in forum Ext GWT: Discussion
    Replies: 14
    Last Post: 24 Oct 2014, 12:18 AM
  2. How: Datepicker next/prev Day Button
    By insnet in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 4 Jan 2013, 1:39 PM
  3. extension datepicker-range (day/week/month)
    By cocorossello in forum Ext 2.x: User Extensions and Plugins
    Replies: 16
    Last Post: 25 Apr 2012, 7:29 PM
  4. DatePicker doesnt close upon selecting (day)
    By aolee in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 26 Oct 2009, 9:39 PM
  5. DatePicker - day of month
    By cmizelle in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 20 Nov 2008, 11:44 AM

Thread Participants: 3