Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6999167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:30:23+00:00 2026-05-27T20:30:23+00:00

I am using dojo 1.6 and using dijit.calendar in a project and it’s working

  • 0

I am using dojo 1.6 and using dijit.calendar in a project and it’s working great except for the goal of colorizing a selected grid cell. I have three innerHTMLs that are being manipulated by the calendar clicks. No problem there.

dijit.calendar’s behavior is to highlight a gridcell (calendar day) as blue when clicked and when another gridcell is clicked, it then turns that blue.
What I’d like to do is colorize the cell a custom color when it’s clicked and have it persistent.

Specifically the calendar is for a project that has an official date (blue), start date (green) and an end date (red).

I’m not even aware that there is a way to colorize a specific gridcell in dijit.calendar. Has anyone successfully done this or have a pointer to send me in the right direction?

Edit below:..

OK folks, I have a pretty good lead on where to go with this thanks to Philippe below. Philippe’s solution will color the cell EXACTLY as intended (so he’s got the answer karma). Turns out that if a selected grid cell is red and I switch to the month to pick a subsequent date, the cell stays red.

I have most of it figured out. I can get, say, the first couple of dates successfully colored but if I have to do something like put in a third date in the next month and change the calendar, the cells stay colored. So there’s going to have to be a way to change my color change to a distinct value that corresponds with the actual date.

I know that onChange that the only argument returned is the Date itself like this (using debug.console in Firebug)…..

[Date {Wed Jan 18 2012 00:00:00 GMT-0500 (EST)}]

I inspected the code through Firebug and noticed in that same cell that the code looks like this….

<td role="gridcell" class="dijitCalendarSelectedDate dijitCalendarCurrentMonth    dijitCalendarDateTemplate" dijitdatevalue="1326866400000" style="background-color: green;" tabindex="0"><span class="dijitCalendarDateLabel">18</span></td>

That distinct value seems to be “dijitdatevalue”.

I suppose I could follow a chain of ……

on click, store the “dijitdatevalue” of the first date in a hidden field (as well as the second and third dates)
Then go back and set the background-color of the corresponding dijitdatevalue to blue, green or red.

Question now is how to return the dijitdatevalue string to a hidden field. I’ll update this post again as I figure out the answer.

Janie

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:30:23+00:00Added an answer on May 27, 2026 at 8:30 pm

    If you look at the widget code you’ll see a private method called _onDayMouseDown which is responsible for turning the cell blue…
    You can add your custom code to that function through dojo.connect, like this :

    dojo.connect(dijit.byId('calendar1'), "_onDayMouseDown", function(/*Event*/ evt){
       var node = evt.target.parentNode;
       dojo.style(node, "backgroundColor", "green");
    });
    

    Otherwise, if you use dojo 1.7, you may give a try to the MultiSelectCalendar

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a project that is using Dojo as the js
I'm using dojo and dijit and have an inlineEditBox widget. I'm trying to capture
I have been using Dojo and Dijit for more than a year to develop
I have been using tinyMCE over dojo dijit.editor because tinyMCE wins out on functionality.
I have been using Dojo hosted on Google's CDN. I just downloaded the development
I have an HTML form using dojo and have the following code for a
I have this problem I'm using DataGrid + dojo.store.JsonRest as store. I want to
I have a Dijit.Tree control written as markup code. Now I'm using the onload
I'm using Dojo 1.5 to create a dijit.form.Select with some data from a datastore.
I am attempting to put together a fairly complex form using dojo and dijit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.