- Home
- Forum
- ASP.NET MVC - EJ 2
- Display schedule on PartialView
Display schedule on PartialView
Hi all,
I've got to display a Schedule inside a partial view.
If I load the partial view content only once, there is no problem.
The problem raise if I unload the partial view content with jquery $("#divcontainer").empty().off("*") and then i reload the content. In this case I can't interact with the schedule anymore.
Can you help me?
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
VD
Vinitha Devi Murugan
Syncfusion Team
September 15, 2021 12:07 PM UTC
Hi Alessandro,
Greetings from Syncfusion Support.
We have validated your reported issue “The problem raise if I unload the partial view content with jquery $("#divcontainer").empty().off("*") and then i reload the content. In this case I can't interact with the schedule anymore.” at our end by preparing sample based on your shared scenario. With the help of button click we unload the partial view scheduler content with $("#divcontainer").empty().off("*") again reload the content on button click, but scheduler interactions working fine at our end. We have shared the working sample with video demo for your reference.
Sample: https://www.syncfusion.com/downloads/support/forum/168832/ze/SchedulePartialViewSample1658837072
Index.cshtml
<div class="col-lg-12 control-section" id="target">
<div class="control-wrapper">
@Html.EJS().Button("showBtn").Content("Click me to show and hide Scheduler").Render()
<div id="scheduleContainer">
</div>
</div>
</div>
<script>
document.getElementById('showBtn').onclick = function () {
if (document.querySelectorAll('.e-schedule').length > 0) {
$("#scheduleContainer").empty().off("*")
} else {
var ajax = new ej.base.Ajax('/Home/PartialView1/?Person2', 'GET', true);
ajax.send().then();
ajax.onSuccess = function (data) {
$("#scheduleContainer").html(data)
};
}
};
</script>
Partialview.cshtml
@using Syncfusion.EJ2.Schedule
<div id="one">
@Html.EJS().Schedule("schedule").Width("700px").Height("650px").SelectedDate(new DateTime(2018, 2, 15)).Render()
</div>
Kindly try the above sample, If you still face the problem at your end, please replicate the same in above sample which would help us to provide the solution at earliest.
Regards,
Vinitha
Marked as answer
AL
Alessandro
September 16, 2021 11:05 AM UTC
I think I found the problem.
I added references to scripts even within the partial view. Removing them the problem has disappeared
NR
Nevitha Ravi
Syncfusion Team
September 17, 2021 07:52 AM UTC
Hi Alessandro,
Thanks for your update.
We are happy that your issue has been resolved at your end. Please let us know if you need any further assisatnce.
Regards,
Nevitha
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
- Marked answer
-
AL Alessandro
- Sep 14, 2021 09:34 AM UTC
- Sep 17, 2021 07:52 AM UTC