Awesome ASP.net Core and MVC Controls

Lookup with CRUD in Popup

using a grid with CRUD functionality in the lookup popup
Lookup:
 
Shared/Demos/LookupCrud.cshtml
@(Html.Awe().Lookup("DinnerCrudLookup")
.Mod(o => o.ShowHeader())
.LookupGrid(Url.Action("DinnerLookup","CrudInLookup"))
.GetItemUrl(Url.Action("GetDinnerItem", "Data"))
.Modal()
.Fullscreen())
CrudInLookup/DinnerLookup.cshtml
@model AwesomeMvcDemo.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" },
new Column { Bind = "Date" },
new Column { Bind = "Chef.FirstName,Chef.LastName", ClientFormat = ".ChefName", Header = "Chef" },
new Column { ClientFormat = ".Meals", Header = "Meals" },
new Column { ClientFormat = Html.EditFormatForGrid(gridId, nofocus: true), Width = 50 }.Mod(o => o.Nohide()),
new Column { ClientFormat = Html.DeleteFormatForGrid(gridId, nofocus: true), Width = 50 }.Mod(o => o.Nohide())))
}
MultiLookup:
  •  
CrudInLookup/Index.cshtml
@(Html.Awe().MultiLookupFor(o => o.Dinner3)
.MultiLookupGrid(Url.Action("DinnerMultiLookup"))
.Mod(o => o.ShowHeader())
.GetItemsUrl(Url.Action("GetDinnerItems", "Data"))
CrudInLookup/DinnerMultiLookup.cshtml
@model AwesomeMvcDemo.ViewModels.Input.Lookup.LookupPopupInput
@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(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", ClientFormat = ".ChefName", Header = "Chef" },
new Column { ClientFormat = ".Meals", Header = "Meals" },
new Column { ClientFormat = Html.EditFormatForGrid(grid1, nofocus:true), Width = 50 }.Mod(o => o.Nohide()),
new Column { ClientFormat = Html.DeleteFormatForGrid(grid1, nofocus: true), Width = 50 }.Mod(o => o.Nohide())))
<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(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", ClientFormat = ".ChefName", Header = "Chef" },
new Column { ClientFormat = ".Meals", Header = "Meals" },
new Column { ClientFormat = Html.EditFormatForGrid(grid2, nofocus: true), Width = 50 }.Mod(o => o.Nohide()),
new Column { ClientFormat = Html.DeleteFormatForGrid(grid2, nofocus:true), Width = 50 }.Mod(o => o.Nohide())))
}



Comments

We use cookies to improve your online experience. By accessing this site, you agree to the use of cookies and other technologies to process your personal data (e.g. IP address) to enhance and personalise your experience across our websites. Additionally, third-party companies, may store cookies on your device and use similar technologies to collect and use certain information. For more information, refer to our privacy policy and cookie policy.