Skip to content

Commit

Permalink
Display all columns if entity has no metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriaWei committed Jan 22, 2021
1 parent 55b9e3b commit 70d5408
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/EasyFrameWork/Mvc/TagHelpers/GridTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,22 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
tableSearchBuilder.Append(TableSearchStructure);
});
}
else
{
foreach (var property in ModelType.GetProperties())
{
tableHeaderBuilder.AppendFormat(TableHeadStructure,
property.Name.FirstCharToLowerCase(),
string.Empty,
OrderAsc == property.Name ? "asc" : OrderDesc == property.Name ? "desc" : "",
property.Name,
string.Empty,
Query.Operators.Equal,
(Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType).Name,
string.Empty);
tableSearchBuilder.Append(TableSearchStructure);
}
}
output.TagName = "div";
//output.Attributes.Add("class", "container-fluid");
output.Content.SetHtmlContent(TableStructure.FormatWith(GridClass, Source, tableHeaderBuilder, tableSearchBuilder));
Expand Down

0 comments on commit 70d5408

Please sign in to comment.