search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

DayPilot Context menu submenu

Asked by David
3 months ago.

Hello,

We are trying to implement a submenu for a Context menu in our Daypilot Scheduler component we but are getting an error indicating ‘items’ does not exist in type ‘MenuItemData’.

The code we are using is the same as in the Javascript example located in https://doc.daypilot.org/menu/submenus/ although it has been rewritten for Typescript.

i.e.
contextMenu: new DayPilot.Menu({
items: [
{ text: "Show event ID", onClick: function () { alert("Event value: " + this.source.value()); } },
{ text: "Show event text", onClick: function () { alert("Event text: " + this.source.text()); } },
{ text: "Show event start", onClick: function () { alert("Event start: " + this.source.start().toStringSortable()); } },
{ text: "Go to google.com", href: "http://www.google.com/?q={0}" },
{ text: "CallBack: Delete this event", command: "delete" },
{
text: "submenu"
,items: [
{text:"Show event ID", onClick: function() {alert("Event value: " + this.source.value());} },
{text:"Show event text", onClick: function() {alert("Event text: " + this.source.text());} }
]
}
]
}),

We have developed our solution using Angular and Typescript in the front-end with a C# backend.

We are currently licensed for and using Daypilot-pro-angular.

Why is it that the items array in the sub-menu not recognized?
How can we get around this issue?

With Thanks,
David

Answer posted by Dan Letecky [DayPilot]
3 months ago.

This was caused by a missing "items" property in the TypeScript definition of MenuItemData interface. It's now fixed in the latest sandbox build (2018.2.3283).

Please let me know if it doesn't work as expected.

New Reply
This reply is
Your name (optional):