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

Vue.js: export and download scheduler as svg

Asked by Max
8 days ago.

Hello,
how can I export to svg by using the scheduler with vue.js. I'm still validating and using the trial version. I tried the tutorial but the function "exportAs" couldn't be found and nothing helped me. Thank you so far.

Answer posted by Dan Letecky [DayPilot]
8 days ago.

If you follow this tutorial:

https://code.daypilot.org/69423/vue-js-scheduler-build-a-reservation-application-in-5-minut

you will be able to access the DayPilot.Scheduler object as "this.scheduler". It's a computed property defined like this:

        computed: {
            // DayPilot.Scheduler object
            // https://api.daypilot.org/daypilot-scheduler-class/
            scheduler: function () {
                return this.$refs.scheduler.control;
            }
        },

You can use it to invoke the DayPilot.Scheduler methods (https://api.daypilot.org/daypilot-scheduler-methods/), including exportAs():

methods: {
    schedulerExport(): function() {
      this.scheduler.exportAs("svg").download("scheduler.svg");
    }
},

New Reply
This reply is
Your name (optional):