This is the requirement.Before
I have used multiple resource grouping and manually set the height of cells and position of appointments with
custom event template of appointment.
but after hovering on sidebar UI getting reset and all the manual setting CSS disappeared.After hovering on Sidebar
Hi Ravi,
Thank you for providing the details of your issue. To better assist you, we would appreciate if you could provide some additional information:
Could you please elaborate on how you've customized the event? Specifically, did you use events like eventRendered or dataBound to customize the appearance or behavior of the events?
Could you please share the code snippet and CSS code you used to manually set the height of cells and position of appointments? This will help us understand how you've customized the layout.
If possible, could you provide issue replicating sample that replicates the issue? This would greatly help us in identifying the root cause.
Your cooperation is greatly appreciated and will help us resolve your issue more efficiently.
Regards,
Ram
Hi Ram,
Thanks for your replay,
-> Hear is the
code snippet of event template for appointment.
<!-- Template for Appointment -->
<template v-slot:eventTemplate="{ data }">
<v-card
height="auto"
:id="data.StartTime"
@click="
$router.push(`/meeting/${data.id}/agenda/tenant/${tenantId}`)
"
class="subject appointment-meeting-template full-width ma-1"
tile
>
<v-row no-gutters class="appointment-meetingName px-1">
{{ data.meetingName }}
</v-row>
<v-row
no-gutters
class="appointment-topic px-1 ma-1"
v-for="(topicCat, index) in data.topicCategory"
:key="index"
>
<v-col cols="12" class="topic-category text-center">{{
topicCat.name
}}</v-col>
<ul class="pl-4" style="width: 100%">
<li v-for="(topic, index) in topicCat.topics" :key="index">
<span class="topic">{{ topic.topicName }}</span>
<v-divider
v-if="index !== topicCat.topics.length - 1"
></v-divider>
</li>
</ul>
</v-row>
</v-card>
</template>
->
code snippet used to manually set the height of cells and position of appointments
onDataBound() {
let scheduleObj = this.$refs.agendaScheduleObj;
console.log("onDataBound.........", scheduleObj);
this.setAgendaUI();
},
setAgendaUI() {
setTimeout(() => {
let appointments = document.getElementsByClassName("e-appointment");
let cells = document.getElementsByClassName(
"e-work-cells e-child-node e-work-days"
);
let agendaCells = document.getElementsByClassName(
"e-resource-cells e-child-node"
);
for (let c = 0; c < cells.length; c++) {
let childrenHeight = 0;
let cell = cells[c];
for (let a = 0; a < appointments.length; a++) {
let appointment = appointments[a];
let appointmentDate = new Date(
appointment.children[0].children[0].id
);
let cellDate = new Date(Number(cell.dataset.date));
if (
appointmentDate.getMonth() == cellDate.getMonth() &&
appointmentDate.getFullYear() == cellDate.getFullYear() &&
cell.dataset.groupIndex == appointment.dataset.groupIndex
) {
childrenHeight += appointment.offsetHeight;
cell.style.height = `${childrenHeight}px`;
if (appointment.previousSibling == null) {
appointment.style.top = `${cell.offsetTop}px`;
} else {
if (
appointment.previousSibling &&
appointment.parentNode.childElementCount
) {
for (
let i = 0;
i < appointment.parentNode.children.length;
i++
) {
let sum = 0;
for (let j = 0; j < i; j++) {
sum += appointment.parentNode.children[j].offsetHeight;
}
appointment.parentNode.children[i].style.top = `${
cell.offsetTop + sum
}px`;
}
}
}
} else {
childrenHeight = 0;
}
// }
}
for (let i = 0; i < agendaCells.length; i++) {
if (agendaCells[i].dataset.groupIndex == cell.dataset.groupIndex) {
agendaCells[i].style.height = `${cell.offsetHeight}px`;
}
}
}
this.resizing = false;
// console.log("resizing end", this.resizing);
}, 100);
},
Thanks and Regards,
Ravi
Hi Ravi,
We've created a sample using a sidebar and customized events, based on the information you provided. We then tested to see if the events were misplaced when toggling the sidebar. However, we were unable to replicate the issue you're experiencing.
we have prepared a stackblitz sample, check on the sample: https://stackblitz.com/edit/schedule-with-sidebar-event-customization
It would be helpful if you could provide more details about your setup or a simple sample that replicates the issue. Alternatively, you could try to replicate the issue in the provided sample and let us know the steps you took. This will help us in identifying the root cause of the problem and provide you with a more accurate solution.
Regards,
Ram
Hi Ram
Thank you for your replay,
Actually I'm using navigation-drawer of vuetify as sidebar.
component:- v-navigation-drawer
Also height of each
appointment
can be different, that's why using custom
event template for appointment.
-> Hear is the code snippet of event template for appointment.
<!-- Template for Appointment -->
<template v-slot:eventTemplate="{ data }">
<v-card
height="auto"
:id="data.StartTime"
@click="
$router.push(`/meeting/${data.id}/agenda/tenant/${tenantId}`)
"
class="subject appointment-meeting-template full-width ma-1"
tile
>
<v-row no-gutters class="appointment-meetingName px-1">
{{ data.meetingName }}
</v-row>
<v-row
no-gutters
class="appointment-topic px-1 ma-1"
v-for="(topicCat, index) in data.topicCategory"
:key="index"
>
<v-col cols="12" class="topic-category text-center">{{
topicCat.name
}}</v-col>
<ul class="pl-4" style="width: 100%">
<li v-for="(topic, index) in topicCat.topics" :key="index">
<span class="topic">{{ topic.topicName }}</span>
<v-divider
v-if="index !== topicCat.topics.length - 1"
></v-divider>
</li>
</ul>
</v-row>
</v-card>
</template>
Also "eventRendered" event of Syncfusion vue Scheduler component getting triggered every time on hover and hover out side of navigation drawer of vuetify.
Packages:-
Regards,
Ravi
Hi Ravi Dudhat,
Based on the code snippets shared, we have created a similar sample using v-navigation-drawer as a sidebar, and tried to replicate the issue but unfortunately we couldn’t able to replicate the issue. It would be helpful if you could provide more details about your setup or a simple sample that replicates the issue. Alternatively, you could try to replicate the issue in the provided sample and let us know the steps you took. This will help us in identifying the root cause of the problem and provide you with a more accurate solution.
Regards,
Ram
Hi Ram,
Please check this updated sample.
I
I'm using these Packages in my project:-
Regards,
Ravi
Hi Ravi Dudhat,
The sample you have provided also has the
same version as the sample we provided. Therefore, we have prepared a similar
sample in Vue 2 using the mentioned version. However, we were unable to see the
issue you are experiencing. It would be helpful if you could provide a sample
that replicates your issue, or you can try to modify our sample to replicate
the issue. Additionally, a video demo could also be helpful in understanding
your issue.
Regards,
Ram
Hi
Ram Raju Elaiyaperumal,
I am sharing the video of issue facing for Syncfusion scheduler.
Regards,
Ravi
Hi Ram Raju Elaiyaperumal,
I am sharing the sample to replicate the issue
for Syncfusion scheduler.
Regards,
Ravi
Hi Ravi Dudhat,
The issue you're encountering may be related to the CSS layout of your application. When the sidebar opens, it triggers the window resize handler, which in turn updates the scheduler. However, during this process, the renderCell and dataBound events are not triggered. This means that any style changes made within these methods are not reflected, leading to the problem you're experiencing.
To resolve this issue, consider updating the scheduler's layout when the sidebar opens. This can be achieved by invoking the refresh method of the scheduler when a resize event occurs. This approach should ensure that all style changes are appropriately applied, thereby addressing the current issue.
Here's an example of how you can do this:
|
<script> import Vue from "vue"; import { SchedulePlugin, TimelineYear } from "@syncfusion/ej2-vue-schedule"; Vue.use(SchedulePlugin); export default { data() { return {
provide: { schedule: [TimelineYear], }, computed: { eventSettings() { return { template: "eventTemplate", dataSource: this.meetingList, enableTooltip: true, }; }, }, methods: { handleResize() { if (this.$refs.scheduleObj) { document.querySelector(".e-schedule").ej2_instances[0].refresh(); } }, },
mounted() { window.addEventListener('resize', this.handleResize); }, beforeDestroy() { window.removeEventListener('resize', this.handleResize); },
watch: { group() { this.drawer = false; }, }, }; </script> |
We have modified the sample, kindly check on the attached sample.
Please let us know if you need further assistance or clarification on this matter.
Regards,
Ram
Hi Ram Raju Elaiyaperumal,
I invoked the refresh method of the scheduler when a resize event occurs, as you suggested.
I am sharing the video for the Syncfusion scheduler as an attachment.
However, I don't think refreshing the scheduler every time a resize event occurs is a good approach for user experience.
Is there an any way to prevent resizing on hover in/out of sidebar?
Regards,
Ravi
Hi Ram Raju Elaiyaperumal,
I got the one solution, for that I have removed some classes when data bound to the scheduler.
Hear I'm sharing the code.
but whenever I'm hovering on Sidebar I'm facing below console errors.
these errors are coming from node_modules Syncfusion.
So can you please give your suggestion for this?
Thanks & Regards,
Ravi
Hi Ravi Dudhat,
We appreciate your patience and understanding. We have included the shared code
you provided and updated the sample, but we couldn’t replicate the issues you
mentioned. We have attached the videos and sample for your reference. Kindly
share the details of any updated code on your end and the e-auto-height styles
you applied, as this will greatly assist us in understanding and resolving the
problem.
Regards,
Ashok
Hi
Ashokkumar Karuppasamy,
I am sharing the updated sample and in this sample I have added the sample video as well to replicate the issue for better understanding.
Thanks & Regards
Ravi
Hi Ravi Dudhat,
Based on the shared details, we have identified the reason for the issue.
Removing the scheduled element classes in the dataBound event will
definitely cause problems. Therefore, based on the details, the appointment
style will be customized in the dataBound event. We suggest using the
same dataBound method with the resize handler event to meet your
requirements.
Additionally, we recommend not adding the style in the render cells event by default. Instead, use a custom class to add and apply the styles. The schedule will not re-render, so using the custom class ensures that the styles are maintained and work properly. Please try this solution and let us know if you need any further assistance.
|
onDataBound() { let scheduleObj = this.$refs.scheduleObj;
console.log("onDataBound.........", scheduleObj);
let appointments = document.getElementsByClassName("e-appointment"); console.log("appointments", appointments);
let cells = document.getElementsByClassName( "e-work-cells e-child-node e-work-days" );
let agendaCells = document.getElementsByClassName( "e-resource-cells e-child-node" );
for (let c = 0; c < cells.length; c++) { let childrenHeight = 0; let cell = cells[c]; for (let a = 0; a < appointments.length; a++) { let appointment = appointments[a]; let appointmentDate = new Date( appointment.children[0].children[0].id ); let cellDate = new Date(Number(cell.dataset.date));
if ( appointmentDate.getMonth() == cellDate.getMonth() && appointmentDate.getFullYear() == cellDate.getFullYear() && cell.dataset.groupIndex == appointment.dataset.groupIndex ) { childrenHeight += appointment.offsetHeight; cell.style.height = `${childrenHeight}px`;
if (appointment.previousSibling == null) { appointment.style.top = `${cell.offsetTop}px`; } else { if ( appointment.previousSibling && appointment.parentNode.childElementCount ) { for ( let i = 0; i < appointment.parentNode.children.length; i++ ) { let sum = 0; for (let j = 0; j < i; j++) { sum += appointment.parentNode.children[j].offsetHeight; }
appointment.parentNode.children[i].style.top = `${ cell.offsetTop + sum }px`; } } } } else { childrenHeight = 0; } // } } for (let i = 0; i < agendaCells.length; i++) { if (agendaCells[i].dataset.groupIndex == cell.dataset.groupIndex) { agendaCells[i].style.height = `${cell.offsetHeight}px`; } } } }, handleResize() { this.onDataBound(); }, }, mounted() { window.addEventListener('resize', this.handleResize); }, beforeDestroy() { window.removeEventListener('resize', this.handleResize); },
watch: { group() { this.drawer = false; }, }, }; </script>
|
Regards,
Ashok
Hi Ashokkumar Karuppasamy,
I am facing the console error whenever hover in/out of vuetify side bar.
I'm getting this error because I have removed below classes that's causing css issue (Scheduler appointments getting overlapped).
So Is there any way to tackle this error?
I am sharing the sample and in this sample I have added the sample video as well to replicate the issue for better understanding.
Thanks & Regards,
Ravi
Hi Ravi Dudhat,
We would like to clarify that
you can remove the built-in styles of the schedule in the e-resource-column
table and e-content-table by removing the element in the dataBound
event. When resizing these elements, adjust the width accordingly. If the
built-in element is removed, the value becomes null, and the width
cannot be retrieved, resulting in a console error. To resolve this, we suggest
updating the dataBound method with the resize handler event as in the
last update. This should resolve the issue. If you encounter any issues with
our previously suggested solution, please share the details so we can
understand and resolve the problem as soon as possible.
Regards,
Ashok