Hi, I wanted to ask how sustainable an approach like the one below would be.
The goal is to have a context menu for each event in the Calendar’s monthly view.
The goal is to have a context menu for each event in the Calendar’s monthly view.
Code:
// using a client-only dataSource so that test data is always relative to the current date
isc.DataSource.create({
ID: "eventDS",
fields: [
{name: "eventId", primaryKey: true, type: "sequence"},
{name: "name"},
{name: "description"},
{name: "startDate", type: "datetime"},
{name: "endDate", type: "datetime"}
],
clientOnly: true,
testData: eventData
});
isc.Calendar.create({
ID: "eventCalendar",
currentViewName: "month",
getDayBodyHTML: function (date, events, calendar, rowNum, colNum) {
var html = this.Super("getDayBodyHTML", arguments)
var newHtml = "";
var links = html.split("<br/>")
for (var index = 0; index < links.getLength(); index++) {
var link = links.get(index);
if (link) {
link = "<a " + "oncontextmenu=\"isc.logEcho('" + events[index].name + "', 'context menu'); return false;\"" + link.substring(3);
newHtml += link + "<br/>";
}
}
return newHtml;
},
startDate: eventData.getDataStartDate(),
dataSource: eventDS, autoFetchData: true
});