Hi Isomorphic
I'm trying to add a context menu that appears when you right-click on an event in a Timeline.
I've tried overriding the getEventCanvasMenuItems method to return an array of MenuItems but this is not working as expected. I also don't see a context button when rolling over the event as mentioned in the Javadoc. Is there something else required?
Here's what I have so far:
I'm using the following:
SmartClient Version: v12.1p_2022-11-23/Pro Deployment (built 2022-11-23)
GWT 2.9.0
Chrome 107.0.5304.107 (Official Build) (64-bit)
Thanks
I'm trying to add a context menu that appears when you right-click on an event in a Timeline.
I've tried overriding the getEventCanvasMenuItems method to return an array of MenuItems but this is not working as expected. I also don't see a context button when rolling over the event as mentioned in the Javadoc. Is there something else required?
Here's what I have so far:
Code:
public void onModuleLoad() {
Timeline timeline = new Timeline() {
@Override
public MenuItem[] getEventCanvasMenuItems(EventCanvas canvas) {
return new MenuItem[] { new MenuItem("Item 1"), new MenuItem("Item 2") };
}
};
timeline.setWidth100();
timeline.setHeight100();
timeline.setStartDate(new Date(122, 10, 25));
timeline.setEndDate(new Date(122, 10, 30));
timeline.setShowEventDescriptions(false);
timeline.setShowEventHeaders(false);
timeline.setCanEditEvents(Boolean.FALSE);
timeline.setShowControlsBar(Boolean.FALSE);
timeline.setLanes(new Lane("lane1", "Lane 1"));
timeline.setData(new CalendarEvent(1, null, null, new Date(122, 10, 26), new Date(122, 10, 27), "lane1"));
timeline.draw();
}
SmartClient Version: v12.1p_2022-11-23/Pro Deployment (built 2022-11-23)
GWT 2.9.0
Chrome 107.0.5304.107 (Official Build) (64-bit)
Thanks
Comment