WebScheduler fails to color selected cell

2 replies. Last post: June 2, 2010 10:45 AM by Andi Santoso
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi all,

I have a problem coloring cells of WebScheduler when one cell is selected: I created a button that call the following code to color cells of 31/05/2010:

function WebScheduler1_Color(controlId) {
var WebScheduler1 = ISGetObject(controlId);

var isHourArea = WebScheduler1.ViewSettings.SelectedViewMode != "Timeline";
var arr = new ISArray();
arr.Add(new WebSchedulerDateRange(new Date(2010, 4, 31, 0, 0, 0, 0), new Date(2010, 4, 31, 23, 0, 0, 0), 1, "DateTime"));
var elements = WebScheduler1.GetCellElements(arr);
SetBackgroundColor(elements, "#555500", isHourArea);
}

function SetBackgroundColor(elements, color, isHourArea) {
for (var i = 0; i < elements.length; i++) {
var el = elements[i];
if (el != null) {
if (isHourArea) {
el.children[0].style.backgroundColor = color;
}
else {
el.style.backgroundColor = color;
}
}
}
}

I attached some snap shots to show you the problem. In the Clipboard01.png, I selected the first cell of 31/05/2010.

Then I push the button "Color", the result is in attachment Clipboard02.png.

Finally I select another cell, and the cell previously selected become white instead of green, see Clipboard03.png

Please can somebody help me?

Regards,

Vince

All times are GMT -5. The time now is 3:37 AM.
Previous Next