@*hide the entire search block if no elements are displayed*@
@await Html.PartialAsync("Table", new DataTablesModel
{
Name = "newsitem-grid",
UrlRead = new DataUrl("List", "News", null),
SearchButtonId = "search-newsitem",
Length = Model.NewsItems.PageSize,
LengthMenu = Model.NewsItems.AvailablePageSizes,
Filters = new List
{
new FilterParameter(nameof(Model.NewsItems.SearchStoreId), nameof(Model.NewsItems)),
new FilterParameter(nameof(Model.SearchTitle))
},
ColumnCollection = new List
{
new ColumnProperty(nameof(NewsItemModel.Title))
{
Title = T("Admin.ContentManagement.News.NewsItems.Fields.Title").Text
},
new ColumnProperty(nameof(NewsItemModel.LanguageName))
{
Title = T("Admin.ContentManagement.News.NewsItems.Fields.Language").Text,
Width = "200"
},
new ColumnProperty(nameof(NewsItemModel.Id))
{
Title = T("Admin.ContentManagement.News.NewsItems.Fields.Comments").Text,
Width = "200",
ClassName = NopColumnClassDefaults.Button,
Render = new RenderCustom("renderColumnComments")
},
new ColumnProperty(nameof(NewsItemModel.StartDateUtc))
{
Title = T("Admin.ContentManagement.News.NewsItems.Fields.StartDate").Text,
Width = "200",
Render = new RenderDate()
},
new ColumnProperty(nameof(NewsItemModel.EndDateUtc))
{
Title = T("Admin.ContentManagement.News.NewsItems.Fields.EndDate").Text,
Width = "200",
Render = new RenderDate()
},
new ColumnProperty(nameof(NewsItemModel.Published))
{
Title = T("Admin.ContentManagement.News.NewsItems.Fields.Published").Text,
Width = "100",
ClassName = NopColumnClassDefaults.CenterAll,
Render = new RenderBoolean()
},
new ColumnProperty(nameof(NewsItemModel.CreatedOn))
{
Title = T("Admin.ContentManagement.News.NewsItems.Fields.CreatedOn").Text,
Width = "200",
Render = new RenderDate()
},
new ColumnProperty(nameof(NewsItemModel.Id))
{
Title = T("Admin.Common.Edit").Text,
Width = "100",
ClassName = NopColumnClassDefaults.Button,
Render = new RenderButtonEdit(new DataUrl("NewsItemEdit"))
}
}
})
@T("Admin.Common.Search")