or
@(Html.Kendo().AutoCompleteFor(model => model.CountryCode)
.Name("acCountry")
.DataTextField("ISO")
.DataSource(ds =>
{
ds.Read(read =>
{
read.Action("GetCountriesForAutoComplete", "Country")
.Data("onAdditionalData");
})
.ServerFiltering(true);
})
)
<
script
>
$.validator.unobtrusive.parse("#CreateRegionForm");
//$('#CreateRegionForm').kendoValidator();
function onAdditionalData() {
return {
text: $("#acCountry").val()
};
}
</
script
>
public
ActionResult GetCountriesForAutoComplete(
string
text)
{
text = text.ToUpper();
var result = FwdManager.Country.GetAll()
.Where(p => p.ISO.Contains(text) || p.NameEsp.Contains(text))
.Select(s =>
new
DtoCountry()
{
Id = s.Id,
ISO = s.ISO,
NameEsp = s.NameEsp,
NameEng = s.NameEng,
Observations = s.Observations,
PAIS_UNION_EUROPEA = s.PAIS_UNION_EUROPEA,
Active = s.Active
});
return
Json(result, JsonRequestBehavior.AllowGet);
}
[HttpPost]
public
JsonResult Create(Region region)
{
//region.CountryCode is null!!!!
JsonResult jsonOutput =
null
;
if
(ModelState.IsValid)
{
try
{
ConvertToUpperCase(region.GetType(), region);
CheckKeyFields(region);
FwdManager.Region.Insert(region);
FwdManager.Commit();
jsonOutput = Json(
new
{ success =
true
});
}
catch
(Exception ex)
{
jsonOutput = ErrorJson(ex);
}
}
else
{
jsonOutput = ErrorJson(ModelState);
}
return
jsonOutput;
}
[AllowCrossSite]
public
ActionResult FallsDataSource([DataSourceRequest] DataSourceRequest request,
string
casenote)
{
IList<FallsAssessEventDTO> events = bedmanEvents.GetEvents(casenote, BedmanEventType.FallsRiskAssessment).Cast<FallsAssessEventDTO>().ToList();
var model = events.Select(e => (FallsAssessment)e).ToList();
AddImages(model);
var queryable = model.AsQueryable();
return
Json(model.ToDataSourceResult(request));
}
datasource.Ajax().Read(read => read.Url("http://" + Request.Url.Host).Action("FallsDataSource", "FallsAssessment", new { Casenote = ViewBag.Casenote }))).Pageable()
I'm experimenting with the scheduler to display some log entries from one of our applications (events with a start / end date - and although I can display the events, the time bands aren't lining up with the events.
The upshot of this is that events happening at 11pm, are showing up in the 8pm band, due to the slippage.
I've attached a screenshot.
The definition is:-
@{
DateTime startDate = ViewBag.InitialDate;
DateTime startTime = ViewBag.StartTime;
@(Html.Kendo().Scheduler<
LogBuddy3.Models.SchedulerEvt
>()
.Name("scheduler")
.Date(startDate)
.StartTime(startTime)
.Height(600)
.Views(views=>
{
views.DayView();
views.WeekView();
views.AgendaView(av=>av.Selected(true));
})
.Editable(false)
.BindTo(Model)
)
}
Thanks
<
head
>
<
title
>Home Page</
title
>
<
link
href
=
"/Content/Site.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"/Content/kendo/2013.2.716/kendo.common.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"/Content/kendo/2013.2.716/kendo.dataviz.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"/Content/kendo/2013.2.716/kendo.default.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"/Content/kendo/2013.2.716/kendo.dataviz.default.min.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
script
src
=
"/Scripts/kendo/2013.2.716/jquery.min.js"
></
script
>
<
script
src
=
"/Scripts/kendo/2013.2.716/kendo.all.min.js"
></
script
>
<
script
src
=
"/Scripts/kendo/2013.2.716/kendo.aspnetmvc.min.js"
></
script
>
<
script
src
=
"/Scripts/kendo.modernizr.custom.js"
></
script
>
</
head
>