\Views\RestInl/Addresses.cshtml
@{
var restId = ViewData["Id"];
var gridId = "AddrGrid-" + restId;
}
@Html.InitDeletePopupForGrid(gridId, "AddressesGridCrud")
<div style="padding: .5em;">
<div class="bar">
<button type="button" class="awe-btn" onclick="$('#@gridId').data('api').inlineCreate()">Create</button>
</div>
@(Html.Awe().Grid(gridId)
.Attr("data-syncg", "addr")
.Parameter("restaurantId", restId)
.Height(230)
.Url(Url.Action("GridGetItems", "AddressesGridCrud"))
.InlEdit(new InlEditOpt{
SaveUrl = Url.Action("CreateInline", "AddressesGridCrud"),
EditUrl = Url.Action("EditInline", "AddressesGridCrud"),
RowClickEdit = true
})
.Groupable(false)
.Columns(
new Column { Bind = "Id", Hidden = true }
.InlReadonly(),
new Column { Bind = "Line1", ClientFormat = ".(Line1)", Header = "Address Line 1" }
.Inl(Html.Awe().TextBox("Line1")),
new Column { Bind = "Line2", ClientFormat = ".(Line2)", Header = "Address Line 2" }
.Inl(Html.Awe().TextBox("Line2")),
new Column { Bind = "Chef.FirstName,Chef.LastName", Prop = "ChefName", Header = "Chef" }
.InlDropdownList(new DropdownListOpt { Name = "ChefId", Url = Url.Action("GetChefs", "Data") }),
Html.InlEditColumn(),
Html.InlDeleteColumn(gridId)))
</div>