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
4 years 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]
4 years 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");
    }
},

Comment posted by Max
4 years ago.

Thank you, that was helpful.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.