Is it possible to pass data dynamically to a dhtmlxScheduler via a data-attribute?
I am attempting to pass dynamic data, specifically a date, to be then used to stop the scheduler from showing events prior to the date I am trying to pass. The scheduler already receive data like api-url
, api-root
and read-only
, but when I try to add more data using data-attribute
I then get undefined
. I tried both using .data()
and .attr()
. Here is my code:
blade.php
<x-scheduler :api-url="route('portal.schedule.events', $project)"
api-root="/portal/schedules"
:read-only="true"
:data-project-start-date="$projectStartDate"
/>
scheduler.js
const schedulerElement = $('#scheduler');
const api_url = schedulerElement.data('api-url');
const api_root = schedulerElement.data('api-root');
const project_start_date = schedulerElement.attr('data-project-start-date');
//const project_start_date = schedulerElement.data('project-start-date');