Our pure JavaScript Scheduler component


Post by boyitech »

Hi,

Now i'm using the Tasks application demo (Angular). I want to use my APIs in my own server but I don't know what to do.
For example , when I add a new resoure item, drag an event to a new location or click 'Save' button when finishing editing event, what should I do that I can listen to these events and use my APIs to send my parameters to my server through functions?

Thanks.


Post by alex.l »

All the best,
Alex


Post by liuxiang »

I listened to the save method. How to get the event data (modified data) currently clicked ?


Post by boyitech »

I used this way to listen to my button event but I can't find any paramter I filled in the Edit Event Form. Where these parameters are or what should I do?

Here's the code:

editorConfig: {
          bbar: {
            items: {
              saveButton: {
                listeners: {
                  click(a) {
                    console.log(a);
                  }
                }
              }
            }
          }
        },

Post by tasnim »

To listen for event save, please use this https://bryntum.com/docs/scheduler-pro/api/SchedulerPro/feature/TaskEdit#event-afterEventSave

Here is an example

listeners : {
	afterEventSave({ eventRecord }) {
		// logic here
	}
}

Best,
Tasnim


Post by liuxiang »

I have implemented listeners of afterEventSave, but the "this" object cannot be obtained in the afterEventSave method.

listeners: {
      afterEventSave({ eventRecord }) {
        console.log(this);      // output undefined
      },
},

What should I do?


Post by alex.l »

What do you expect to have as a scope of this method?
The scope of JS functions is depends on many aspects, same for listeners, as well on the way you add listeners and declared method.
Please review event params list https://bryntum.com/docs/scheduler-pro/api/SchedulerPro/feature/TaskEdit#event-afterEventSave
If you expected to have editor as a scope, it's available in params.

Also review docs https://bryntum.com/docs/scheduler-pro/api/Core/mixin/Events#function-on
There are few ways to add listeners, also possible to set a scope for the listener.

All the best,
Alex


Post by liuxiang »

Can you provide some demos about angular?


Post by alex.l »

Sure.
All demos are available in sources you downloaded.
Please check by path: /examples/frameworks/angular
also examples-scheduler/frameworks/angular

All the best,
Alex


Post Reply