Hi,
In my web page I have a Grid and a Schedule.
When I drag a grid row into the schedule, I open a custom dialog and then update the appointment using a ajax call to a controller method.
The schedule is defined as follows:
<div id="COL2">
@(Html.EJ().Schedule("WorkActivitySchedule")
.Locale("it-IT")
.Width("100%")
.Height("800px")
.Views(view)
.Orientation(Orientation.Horizontal)
.ShowCurrentTimeIndicator(true)
.CategorizeSettings(fields => fields.Datasource(ViewBag.categorize).Enable(true).AllowMultiple(false).Id("id").Text("text").Color("color").FontColor("fontColor"))
.DateFormat("dd/MM/yyyy")
.AllowDragDrop(true)
.EnableAppointmentResize(true)
.CurrentDate(System.DateTime.Now)
.Resources(res =>
{
res.Field("OperatorId").Title("Operator").Name("Operators").AllowMultiple(true)
.ResourceSettings(flds => flds.Datasource((IEnumerable)ViewBag.Operators).Text("text").Id("id").GroupId("groupId").Color("color")).Add();
})
.Group(gr =>
{
gr.Resources(ViewBag.Resources);
})
.AppointmentSettings(fields => fields.Datasource(ds => ds.Json((IEnumerable<PlannedWorkActivity>)Model).Adaptor(AdaptorType.UrlAdaptor))
.Id("Id")
.Subject("Subject")
.StartTime("StartTime")
.EndTime("EndTime")
.Description("Description")
.AllDay("False")
.Recurrence("")
.RecurrenceRule("")
.Categorize("Categorize")
.ResourceFields("OperatorId")
)
.ScheduleClientSideEvents(evt =>
evt.Create("onCreate")
.CellClick("onCellClick")
.AppointmentClick("onAppointmentClick")
.AppointmentSaved("onAppointmentSaved")
.AppointmentEdited("onAppointmentEdited")
.ResizeStop("onResizeStop")
.ActionComplete("onActionComplete")
.DragStop("onDragStop")
))
</div>
The grid is defined as follows:
<div style="padding: 10px; text-align: center">
@(Html.EJ().Grid<SlimHub.ViewModels.WorkActivityToPlan>("WorkActivitiesGrid")
.Datasource(ds => ds.URL("../WorkActivity/WorkActivitiesToPlan").Adaptor(AdaptorType.UrlAdaptor))
.AllowResizing()
.AllowTextWrap(true)
.AllowRowDragAndDrop()
.AllowPaging()
.AllowFiltering()
.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
.Columns(col =>
{
col.Field("WorkActivityId").HeaderText("Id").HeaderTextAlign(TextAlign.Center).Visible(false).Add();
col.Field("WorkCode").HeaderText("Attività").Template("#ActivityToPlanTemplate").HeaderTextAlign(TextAlign.Center).TextAlign(TextAlign.Right).Width(30).Add();
})
.ClientSideEvents(s => s.RowDrop("onRowDrop").RowDragStart("onRowDrag"))
)
</div>
After dropping the row on the schedule, the appointment (that is the PlannedWork object) is correctly updated on the database, but the schedule doesnn't refresh, so I can see the planned activity only after the page is reloaded.
Is there a way to refresh the schedule without loading the whole page?
Thank you.
Claudio