BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
$('#tab-agenda').click(function () {
$.ajax({
url: 'Calendar/Agenda',
cache: false,
dataType: 'html',
success: function (data) {
$('#main-container').html(data);
$('#main-container').effect('slide', { direction: 'up' }, 200);
ej.widget.init($("div#agenda"));
}
});
});
This is now my CalenderController action:
public ActionResult Agenda()
{
List<ScheduleData> data = new List<ScheduleData> {
new ScheduleData {
ProgramName = "Turtle Walk",
Comments = "Night out with turtles",
ProgramStartTime = new DateTime(2016, 6, 2, 3, 0, 0),
ProgramEndTime = new DateTime(2016, 6, 2, 4, 0, 0),
IsAllDay = true
},
new ScheduleData {
ProgramName = "Winter Sleepers",
Comments = "Long sleep during winter season",
ProgramStartTime = new DateTime(2016, 6, 3, 1, 0, 0),
ProgramEndTime = new DateTime(2016, 6, 3, 2, 0, 0)
},
new ScheduleData {
ProgramName = "Estivation",
Comments = "Sleeping in hot season",
ProgramStartTime = new DateTime(2016, 6, 4, 3, 0, 0),
ProgramEndTime = new DateTime(2016, 6, 4, 4, 0, 0)
}
};
return PartialView("_agenda", data);
}
The partial view contains only this :
<div id="agenda" class="page-article">
<div class="row">
<br />
</div>
<div class="row">
<div class="col s10 m10 l10 offset-l2">
@(Html.EJ().Schedule("Schedule1")
.CurrentDate(DateTime.Now)
.TimeMode(TimeMode.Hour24))
</div>
</div>
</div>
Kind Regards
OriteK
Hi Karthigeyan,I've been able to try the attached sample, it is fully working.But this sample cannot be applied to my issue. In your attached sample, you are calling the scheduler in your index.cshtml view.This view is called by the controller HomeController using an ActionResult method. (This works if I use it on my app)For my case, I'm trying to call the scheduler inside a Partial view, using AJAX$('#tab-agenda').click(function () {
$.ajax({
url: 'Calendar/Agenda',
cache: false,
dataType: 'html',
success: function (data) {
$('#main-container').html(data);
$('#main-container').effect('slide', { direction: 'up' }, 200);
ej.widget.init($("div#agenda"));
}
});
});
This is now my CalenderController action:
public ActionResult Agenda()
{
List<ScheduleData> data = new List<ScheduleData> {
new ScheduleData {
ProgramName = "Turtle Walk",
Comments = "Night out with turtles",
ProgramStartTime = new DateTime(2016, 6, 2, 3, 0, 0),
ProgramEndTime = new DateTime(2016, 6, 2, 4, 0, 0),
IsAllDay = true
},
new ScheduleData {
ProgramName = "Winter Sleepers",
Comments = "Long sleep during winter season",
ProgramStartTime = new DateTime(2016, 6, 3, 1, 0, 0),
ProgramEndTime = new DateTime(2016, 6, 3, 2, 0, 0)
},
new ScheduleData {
ProgramName = "Estivation",
Comments = "Sleeping in hot season",
ProgramStartTime = new DateTime(2016, 6, 4, 3, 0, 0),
ProgramEndTime = new DateTime(2016, 6, 4, 4, 0, 0)
}
};
return PartialView("_agenda", data);
}
The partial view contains only this :
<div id="agenda" class="page-article">
<div class="row">
<br />
div>
<div class="row">
<div class="col s10 m10 l10 offset-l2">
@(Html.EJ().Schedule("Schedule1")
.CurrentDate(DateTime.Now)
.TimeMode(TimeMode.Hour24))
div>
div>
div>
Kind Regards
OriteK