or
@(Html.Kendo().Scheduler<
xxx.Website.Models.Lesson
>()
.Name("scheduler")
.Date(new DateTime(2014, 12, 12))
.StartTime(new DateTime(2014, 12, 8, 9, 00, 00))
.EndTime(new DateTime(2014, 12, 5, 14, 00, 0))
.Height(700)
.AllDaySlot(false)
.Views(views =>
{
views.WeekView();
})
.Resources(resource =>
{
resource.Add(m => m.LessonType).Title("Lesson Type").DataTextField("Text").DataValueField("Value").DataColorField("Color").BindTo(new[]{
new { Text = "Group1", Value=1, Color="#DC8166"},
new { Text = "Group2", Value=2, Color="#889DAE"},
new { Text = "Group3", Value=3, Color="#91DE80"},
new { Text = "Group4", Value=4, Color="#FFD24D"}
});
})
.Timezone("UTC")
.Editable(false)
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.Id);
m.Field(f => f.Title).DefaultValue("No title");
})
.Read(read => read.Action("Read_Scheduler", "Administration").Data("getDates"))
)
)
function
openTrainWind(trainID) {
var
window = $(
"#trainWindow"
).data(
"kendoWindow"
);
window.ajaxRequest(
"/Trains/_Trains/"
, { _trainID: trainID });
window.center().open();
}
@Html.DropDownListFor(m => m,
new
SelectList(ViewBag.Partners,
"Id"
,
"FriendlyName"
),
"Select Partner"
)
@(Html.Kendo().DropDownListFor(m => m)
.BindTo(
new
SelectList(ViewBag.Partners,
"Id"
,
"FriendlyName"
))
.OptionLabel(
"Select Partner"
))
<
ul
unselectable
=
"on"
class
=
"k-list k-reset"
tabindex
=
"-1"
role
=
"listbox"
aria-hidden
=
"true"
id
=
"PartnerId_listbox"
aria-live
=
"off"
style
=
"overflow: auto; height: auto;"
><
li
tabindex
=
"-1"
role
=
"option"
unselectable
=
"on"
class
=
"k-item"
>Select Partner</
li
><
li
tabindex
=
"-1"
role
=
"option"
unselectable
=
"on"
class
=
"k-item"
>Indicia Test SFTP</
li
><
li
tabindex
=
"-1"
role
=
"option"
unselectable
=
"on"
class
=
"k-item"
>Indicia Test Mail</
li
><
li
tabindex
=
"-1"
role
=
"option"
unselectable
=
"on"
class
=
"k-item"
>Indicia Test FS</
li
><
li
tabindex
=
"-1"
role
=
"option"
unselectable
=
"on"
class
=
"k-item k-state-selected k-state-focused"
id
=
"PartnerId_option_selected"
aria-selected
=
"true"
>Test Jesse</
li
></
ul
>
/// <summary>
/// Populates the partners.
/// </summary>
protected
void
PopulatePartners()
{
ViewBag.Partners = Database.Partners.Select(pg =>
new
{ pg.Id, pg.FriendlyName }).ToArray();
}
<
div
style
=
"width:830px;font-size:x-small; padding-top:40px;"
>
@(Html.Kendo().Grid<
SystemsFormsMVC.Models.vMyForm
>()
.Name("Grid1")
.Columns(columns=>
{
columns.Bound(o => o.Id);
columns.Bound(o => o.SystemName);
columns.Bound(o => o.FormType);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action("GetMyForms", "Home"))
)
.Pageable()
.Navigatable()
.Sortable()
.Filterable()
)
</
div
>
public
ActionResult GetMyForms([DataSourceRequest] DataSourceRequest request)
{
var query = _repository.GetMyForms(GetCurrentUserName());
query = query.OrderBy(s => s.RequestDate);
return
Json(query, JsonRequestBehavior.AllowGet);
}
public
IQueryable<vMyForm> GetMyForms(
string
UserName)
{
SystemsFormsDataContext db =
new
SystemsFormsDataContext();
IQueryable<vMyForm> query;
Int32 UserId = GetCurrentUserId(UserName);
try
{
query = (from s
in
db.vMyForms
where s.UserId == UserId
select s);
}
catch
(Exception ex)
{
query = (from s
in
db.vMyForms
where s.UserId == 0
select s);
}
return
query;
}