Our pure JavaScript Scheduler component


Post by Highnoon »

Hi,

EventContextMenu is not working when started in WebServer. I took your example from the documentation.
eventContextMenu: {
      // Add extra items shown for each event
     extraItems: [{
              text: 'Move left',
              icon: 'b-fa b-fa-fw b-fa-arrow-left',
              cls: 'b-separator',
              onItem: function onItem(_ref) {
                      var eventRecord = _ref.eventRecord;
                      eventRecord.startDate = bryntum.scheduler.DateHelper.add(eventRecord.startDate, -1, 'hour');
              }
     }, {
               text: 'Move right',
               icon: 'b-fa b-fa-fw b-fa-arrow-right',
               onItem: function onItem(_ref2) {
                   var eventRecord = _ref2.eventRecord;
                   eventRecord.startDate = bryntum.scheduler.DateHelper.add(eventRecord.startDate, 1, 'hour');
                }
      }],
}, //eventContextMenu
It appears only once. When I click on a second event i get this exception.

Version 1.2.2

Thanks
Attachments
EventContextMenu.png
EventContextMenu.png (93.56 KiB) Viewed 1298 times

Post by mats »

We could not reproduce this issue. To assist you with your question, please provide more details including a runnable test case (as described in our support guidelines).

To get the fastest possible support, provide a simple test case based on our standard examples.

Post by Highnoon »

Hi,

the exception appear just when i use scheduler in our framework. As you see we need prototype.js.
Is there a way to do our own context menu? I tryed oncontextmenu and contextmenu both are not working.
listeners: {
   contextmenu: function (clicky) {
         let menu = new bryntum.scheduler.Menu({
               forElement: btn.element,
               items: [{
                    icon: 'b-icon b-icon-add',
                    text: 'Add'
                }, {
                    icon: 'b-icon b-icon-trash',
                    text: 'Remove'
                }
                // Method is called for all ancestor levels
                onItem: function( item ) {
                    toast('You clicked ' + item.text);
                }
            });
},
Thank you

Post by pmiklashevich »

new Scheduler({
    features : {
        eventContextMenu : false
    },

    listeners : {
        eventContextMenu : ({ source : scheduler, eventRecord, event }) => {
            console.log(scheduler, eventRecord, event);
        }
    },
Docs: https://www.bryntum.com/docs/scheduler/ ... ontextMenu

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply