Lookup with CRUD inside its Popup

Lookup with CRUD in Popup

using a grid with CRUD functionality in the lookup popup
Lookup:
 
Shared/Demos/LookupCrud.cshtml
@(Html.Awe().Lookup(new LookupOpt { 
Name = "DinnerCrudLookup" ,
ClearButton = true,
Dropdown = false,
Fullscreen = true,
Modal = true,
GetItemUrl = Url.Action("GetDinnerItem", "Data")
})
.LookupGrid(Url.Action("DinnerLookup", "CrudInLookup")))
CrudInLookup/DinnerLookup.cshtml
@model AweCoreDemo.ViewModels.Input.Lookup.LookupPopupInput
@using (Html.Awe().BeginContext())
{
var gridId = "DinnersGrid";

@Html.InitCrudPopupsForGrid(gridId, "DinnersGridCrud")

<div class="bar">
<div style="float: right;">
@Html.Awe().TextBoxFor(o => o.Search).Placeholder("search...").CssClass("searchtxt")
</div>
@Html.CreateButtonForGrid(gridId)
</div>

@(Html.Awe().Grid(gridId)
.Mod(o => o.PageInfo().ColumnsSelector().KeyNav().ColumnsAutohide())
.Url(Url.Action("GridGetItems", "DinnersGridCrud"))
.Parent(o => o.Search, "search")
.Selectable(SelectionType.Single)
.Height(350)
.Columns(
new Column { Bind = "Id", Width = 55 },
new Column { Bind = "Name" }.Mod(o => o.Nohide()),
new Column { Bind = "Date" },
new Column { Bind = "Chef.FirstName,Chef.LastName", Prop = "ChefName", Header = "Chef" },
new Column { Prop = "Meals", Header = "Meals" },
new Column { ClientFormat = Html.EditFormatForGrid(gridId, nofocus: true), Width = GridUtils.EditBtnWidth }.Mod(o => o.Nohide()),
new Column { ClientFormat = Html.DeleteFormatForGrid(gridId, nofocus: true), Width = GridUtils.DeleteBtnWidth }.Mod(o => o.Nohide())))
}
MultiLookup:
  •  
CrudInLookup/Index.cshtml
@(Html.Awe().MultiLookup(new MultiLookupOpt
{
Name = "Dinner3",
ClearButton = true,
Modal = true,
Dropdown = false,
Fullscreen = true,
GetItemsUrl = Url.Action("GetDinnerItems", "Data"),
})
.MultiLookupGrid(Url.Action("DinnerMultiLookup")))
CrudInLookup/DinnerMultiLookup.cshtml
@model AweCoreDemo.ViewModels.Input.Lookup.LookupPopupInput
@functions{
Column[] getColumns(string gridId)
{
return new[]
{
new Column {Bind = "Id", Width = 120, ClientFormat = GridUtils.MoveBtn() + " .(Id)"}.Mod(o => o.Nohide()),
new Column {Bind = "Name"}.Mod(o => o.Nohide()),
new Column {Bind = "Date"},
new Column {Bind = "Chef.FirstName,Chef.LastName", Prop = "ChefName", Header = "Chef"},
new Column {Prop = "Meals", Header = "Meals"},
new Column {ClientFormat = Html.EditFormatForGrid(gridId, nofocus: true), Width = GridUtils.EditBtnWidth}.Mod(o => o.Nohide()),
new Column {ClientFormat = Html.DeleteFormatForGrid(gridId, nofocus: true), Width = GridUtils.DeleteBtnWidth}.Mod(o => o.Nohide())
};
}
}

@using (Html.Awe().BeginContext())
{
var grid1 = "DinnersGrid1";
var grid2 = "DinnersGrid2";

@Html.InitCrudPopupsForGrid(grid1, "DinnersGridCrud")
@Html.InitCrudPopupsForGrid(grid2, "DinnersGridCrud")

<div class="bar">
<div style="float: right;">
@Html.Awe().TextBoxFor(o => o.Search).Placeholder("search...").CssClass("searchtxt")
</div>
@Html.CreateButtonForGrid(grid1)
</div>

@(Html.Awe().Grid(grid1)
.Mod(o => o.PageInfo().KeyNav().MovableRows(x => x.DropOn("DinnersGrid1").DropOn("DinnersGrid2")).ColumnsAutohide())
.CssClass("awe-srl")
.Url(Url.Action("DinnersGridSearch"))
.Parent(o => o.Search, "search")
.Height(200)
.Groupable(false)
.Columns(getColumns(grid1)))
<br />

@(Html.Awe().Grid(grid2)
.Mod(o => o.PageInfo().KeyNav().MovableRows(x => x.DropOn("DinnersGrid1").DropOn("DinnersGrid2")).ColumnsAutohide())
.CssClass("awe-sel")
.Url(Url.Action("DinnersGridSelected"))
.Height(200)
.Groupable(false)
.Paging(false)
.Columns(getColumns(grid2)))
}



Comments