or
<% var culture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString(); %>
<
script
src
=
"<%= this.ResolveUrl("
~/Scripts/kendo/2014.2.903/cultures/kendo.culture." + culture + ".min.js") %>" type="text/javascript"></
script
>
<
script
type
=
"text/javascript"
>
kendo.culture("<%= culture %>");
</
script
>
@(Html.Kendo().Grid<
PoLineItemModel
>().Name("grdPoLines")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(m => m.Id))
.Batch(true)
.ServerOperation(false)
.PageSize(20)
.Events(events =>
{
events.RequestEnd("onRequestEnd");
events.Change("onRequestEnd");
})
.Create(create => create.Action("Ajax_CreatePoLines","PoHeaders", new { poid = Model.Id}))
.Read(read => read.Action("Ajax_ReadPoLines", "PoHeaders", new { poid = Model.Id }))
.Update(update => update.Action("Ajax_UpdatePoLines", "PoHeaders", new { poid = Model.Id }))
)
.Columns(columns =>
{
columns.Bound(m => m.PoHeaderId).Visible(false);
columns.Bound(m => m.Id);
columns.Bound(m => m.PartId);
columns.Bound(m => m.Quantity);
columns.Bound(m => m.UnitPrice);
})
.ToolBar(toolbar =>
{
toolbar.Save();
toolbar.Create();
})
.Navigatable()
.Sortable()
.Filterable()
.Groupable()
.Editable(edit => edit.Mode(GridEditMode.InCell))
)
public
ActionResult Ajax_CreatePoLines([DataSourceRequest] DataSourceRequest request, [Bind(Prefix =
"models"
)]IEnumerable<PoLineItemModel> poItems)
{
var poid = Int32.Parse(Request.QueryString[
"poid"
]);
var ldb =
new
ShopTrackEntities();
foreach
(var newitem
in
poItems)
{
var newline =
new
PoLine
{
PoHeaderId = poid,
PartId = newitem.PartId,
Quantity = newitem.Quantity,
UnitPrice = newitem.UnitPrice
};
ldb.PoLines.Add(newline);
}
ldb.SaveChanges();
var allitems = GetPoLineItems(poid);
var lines =
new
List<PoLineItemModel>();
foreach
(var item
in
allitems)
{
var additem =
new
PoLineItemModel
{
Id = item.Id,
PoHeaderId = item.PoHeaderId,
PartId = (
int
)item.PartId,
Quantity = (
int
)item.Quantity,
UnitPrice = (
decimal
)item.UnitPrice
};
lines.Add(additem);
}
return
Json(lines.ToDataSourceResult(request,ModelState));
}
@{
Layout = "~/Areas/razor/Views/Shared/_MobileLayout.cshtml";
}
<!DOCTYPE html>
<
html
>
<
head
>
<
title
></
title
>
<
link
href
=
"~/Content/kendo/2013.2.716/kendo.common.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"~/Content/kendo/2013.2.716/kendo.default.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"~/Content/kendo/2013.2.716/kendo.mobile.flat.min.css"
/
rel
=
"stylesheet"
>
<
script
src
=
"~/Scripts/kendo/2013.2.716/jquery.min.js"
></
script
>
<
script
src
=
"~/Scripts/kendo/2013.2.716/kendo.all.min.js"
></
script
>
</
head
>
<
body
>
@RenderBody()
</
body
>
</
html
>
@(Html.Kendo().MobileView()
.Name("loginView")
.Title("Stimline Mobile")
.Content(
@<
text
>
<
h2
>New login form goes here</
h2
>
</
text
>
)
)
<!DOCTYPE html>
<
html
>
<
head
>
<
title
></
title
>
<
link
href
=
"/Content/kendo/2013.2.716/kendo.common.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"/Content/kendo/2013.2.716/kendo.default.min.css"
rel
=
"stylesheet"
/>
<
link
href
=
"/Content/kendo/2013.2.716/kendo.mobile.flat.min.css"
/
rel
=
"stylesheet"
>
<
script
src
=
"/Scripts/kendo/2013.2.716/jquery.min.js"
></
script
>
<
script
src
=
"/Scripts/kendo/2013.2.716/kendo.all.min.js"
></
script
>
</
head
>
<
body
>
<
div
data-reload
=
"false"
data-role
=
"view"
data-stretch
=
"false"
data-title
=
"Stimline Mobile"
data-use-native-scrolling
=
"false"
data-zoom
=
"false"
id
=
"loginView"
><
div
data-role
=
"content"
>
<
h2
>New login form goes here</
h2
>
</
div
></
div
>
</
body
>
</
html
>
@(Html.Kendo()
.Grid<
TestFilterTemplate.Models.Model
>()
.Name("MainGrid")
.Columns(cols => {
cols.Bound(e => e.Id);
cols.Bound(e => e.Name);
})
.ClientDetailTemplateId("testtemplate")
.DataSource(data => {
data.Ajax().Read(read => read.Action("ListA", "Value"));
})
)
<
script
type
=
"text/html"
id
=
"testtemplate"
>
@(Html.Kendo()
.Grid<
TestFilterTemplate.Models.Model
>()
.Name("InnerGrid")
.Filterable() //<--- remove me and i work.
.Columns(cols => {
cols.Bound(e => e.Id);
cols.Bound(e => e.Name);
})
.DataSource(data => {
data.Ajax().Read(read => read.Action("ListA", "Value"));
}).ToClientTemplate()
)
</
script
>
@(Html.Kendo().TabStrip()
.Name("tabstrip")
.Items(tabstrip =>
{
foreach (var tab in @Model)
{
tabstrip.Add().Text(tab.ComponentTypes).Content(@<
text
>
@(Html.Kendo().Grid<
Portal.Entity.ComponentProperty
>().Name("grids" + tab.ComponentTypes)
//+ DateTime.Now.ToString().Replace(" ", ""))
.Columns(columns =>
{
}) .HtmlAttributes(new { style = "width: 980px;height: 800px" })
.Scrollable().Sortable().Pageable().DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetDetails", "ComponentProperties", new { PropertyName = tab.ComponentTypes } ))
.ServerOperation(false) ))
</
text
>
);
}
})