Search
Item.cssClass Property
See Also
 






Gets or sets the css class of the Item.

Namespace: MindFusion.Scheduling
File: Item.js

 Syntax

JavaScript  Copy Code

get cssClass() {}

 Property Value

A String that specifies the name of the css theme file. If necessary, specify the full path to the theme file.

 Remarks

The css file with the theme should be located in a directory "themes" at the same level as the JavaScript file with the Calendar that references it. If not, specify the full path.

 Example

The following code creates schedule items and assigns a custom CSS class to each 5th of them.

JavaScript  Copy Code

// add some items to the schedule items collection
for (var i = 0; i < 15; i++)
{
 item = new p.Item();
 item.startTime = p.DateTime.addMinutes(date, 2);
 item.endTime = p.DateTime.addHours(item.startTime, 2);
 item.subject = "Yoga";

 // add a custom css class to some items
 if (i % 5 == 0)
 {
  item.cssClass = "myItemClass";
  item.details = "It is of utmost importance!"
 }
 calendar.schedule.items.add(item);
}

 See Also