Show cool things you have done with our products


Post by ddsultan »

Hi all,

I am using the latest version of Scheduler(Trail) with calendar mode (ext 6, Chrome latest).

I have got an important issue. Is it possible to show "Sch.plugin.EventEditor" on firing different events for example on 'doubleclick' to create an event.

What is the correct way to do that? I called 'show' method adding a new Event model, but the workaround seems incorrect. In fact I prefer to repeat (emulate) the process of creating a new Event on other events (when fired). Is it possible to that?

Thanks

Post by Maxim Gorkovsky »

Hello.
Here's a small snippet:
var view = scheduler.getSchedulingView();
view.on('itemdblclick', function () { 
  var newEvent = s.eventStore.add({ ... }); // add will return array
  var p = // get your eventeditor plugin here
  p.show(newEvent[0]); 
});
Event record should be rendered - i.e. belong to time axis, or you can pass element to align this editor to as second argument:
p.show(record, view.getEl());

Post by ddsultan »

Hi,

Thank you for your response. It is showing now, but out of the Scheduler view.
var view = s.getSchedulingView();
           view.on('itemdblclick', function (view, item, el, index, e) {

                        var newEvent = s.eventStore.add({}) // add will return array
                        ,rec = newEvent[0]
                        ,p = me.myeditor; // get your eventeditor plugin here

                        p.show(rec, el);
                     }
So, how can use TimeAxis to render it at (or near) double click point?

Thanks

Post by mats »

Use 'scheduleclick' instead which contains information about the date. https://www.bryntum.com/products/gantt-for-extjs/docs/ ... eduleclick

Post by ddsultan »

Hi Mats,

Yes you are right. In fact that was I was using. Only problem I have now is that EventEditor is not displaying correctly (not like when we do on creating a new event on resize with drag). It is displaying out of view. Could you give me some hints so that I can display it correctly like that? Here is a screenshot(as an attachment) with 'scheduledblclick' which is out of view.
Attachments
Event Editor out of view
Event Editor out of view
bryntumscheduler.png (133.46 KiB) Viewed 11156 times

Post by Maxim Gorkovsky »

When you pass element to align editor to we call:
alignTo(el, 'tl-tr')
and currently you're aligning this window to row (or view?).
Try using
p.show(rec)
this way editor will be aligned according to event element.

Post by ddsultan »

Hi Maxim,

I am trying to display the window close to the event being created (not out of the view).
I have tried that one
p.show(rec);
. There is a problem: Window panel is collapsed.
And I have got another error here while using
p.show(rec);
Uncaught TypeError: Cannot read property 'el' of undefined
That is why I have been trying to use
p.show(rec, someEl);
Case: Editor example with calendar mode.

Thanks

Post by Maxim Gorkovsky »

That means event record wasn't rendered. Here's what you can try to do: create some temporary html element with id by coordinates from event and align event editor to it. Delete that element from dom after event editor is hidden (e.g. listen to hide event)

Post by ddsultan »

Hi,

What do you mean by 'That means event record wasn't rendered.'? It means it has got a bug or?
I know event record is there (See the attachment). It could be possible that I have missed something.

It would be better to resolve the issue than to create element for the editor to be aligned.

Thanks
Attachments
eventeditor.png
eventeditor.png (51.59 KiB) Viewed 11146 times

Post by Maxim Gorkovsky »

I mean there's probably no DOM node for this record. It may be because event does not belong to current time span, or was filtered/hidden, or smth else.
It's hard to tell what's going on there without seeing code. If you wrap this into a runnable test case we can take a look into it to see if there's a bug.

Post Reply