@*hide the entire search block if no elements are displayed*@
@await Html.PartialAsync("Table", new DataTablesModel
{
Name = "templates-grid",
UrlRead = new DataUrl("List", "MessageTemplate", null),
SearchButtonId = "search-templates",
Length = Model.PageSize,
LengthMenu = Model.AvailablePageSizes,
Filters = new List
{
new FilterParameter(nameof(Model.SearchKeywords)),
new FilterParameter(nameof(Model.SearchStoreId)),
new FilterParameter(nameof(Model.IsActiveId))
},
ColumnCollection = new List
{
new ColumnProperty(nameof(MessageTemplateModel.Name))
{
Title = T("Admin.ContentManagement.MessageTemplates.Fields.Name").Text
},
new ColumnProperty(nameof(MessageTemplateModel.Subject))
{
Title = T("Admin.ContentManagement.MessageTemplates.Fields.Subject").Text
},
new ColumnProperty(nameof(MessageTemplateModel.IsActive))
{
Title = T("Admin.ContentManagement.MessageTemplates.Fields.IsActive").Text,
Width = "100",
ClassName = NopColumnClassDefaults.CenterAll,
Render = new RenderBoolean()
},
new ColumnProperty(nameof(MessageTemplateModel.ListOfStores))
{
Title = T("Admin.ContentManagement.MessageTemplates.Fields.LimitedToStores").Text,
Width = "300"
},
new ColumnProperty(nameof(MessageTemplateModel.Id))
{
Title = T("Admin.Common.Edit").Text,
Width = "100",
ClassName = NopColumnClassDefaults.Button,
Render = new RenderButtonEdit(new DataUrl("Edit"))
}
}
})
@T("Admin.Common.Search")