@*hide the entire search block if no elements are displayed*@
@await Html.PartialAsync("Table", new DataTablesModel
{
Name = "campaigns-grid",
UrlRead = new DataUrl("List", "Campaign", null),
SearchButtonId = "search-campaigns",
Length = Model.PageSize,
LengthMenu = Model.AvailablePageSizes,
Filters = new List
{
new FilterParameter(nameof(Model.StoreId))
},
ColumnCollection = new List
{
new ColumnProperty(nameof(CampaignModel.Name))
{
Title = T("Admin.Promotions.Campaigns.Fields.Name").Text
},
new ColumnProperty(nameof(CampaignModel.CreatedOn))
{
Title = T("Admin.Promotions.Campaigns.Fields.CreatedOn").Text,
Width = "200",
Render = new RenderDate()
},
new ColumnProperty(nameof(CampaignModel.DontSendBeforeDate))
{
Title = T("Admin.Promotions.Campaigns.Fields.DontSendBeforeDate").Text,
Width = "200",
Render = new RenderDate()
},
new ColumnProperty(nameof(CampaignModel.Id))
{
Title = T("Admin.Common.Edit").Text,
Width = "100",
ClassName = NopColumnClassDefaults.Button,
Render = new RenderButtonEdit(new DataUrl("Edit"))
}
}
})
@T("Admin.Common.Search")