Browse Source
Add `PropertyName` and use it as sort field.
pull/16172/head
maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
3 changed files with
13 additions and
3 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/Extensibility/TableColumns/TableColumn.cs
-
framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs
-
framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor
|
|
|
@ -10,14 +10,22 @@ public class TableColumn |
|
|
|
{ |
|
|
|
public string Title { get; set; } |
|
|
|
public string Data { get; set; } |
|
|
|
|
|
|
|
public string PropertyName { get; set; } |
|
|
|
|
|
|
|
[CanBeNull] |
|
|
|
public string DisplayFormat { get; set; } |
|
|
|
|
|
|
|
public IFormatProvider DisplayFormatProvider { get; set; } = CultureInfo.CurrentCulture; |
|
|
|
|
|
|
|
[CanBeNull] |
|
|
|
public Type Component { get; set; } |
|
|
|
|
|
|
|
public List<EntityAction> Actions { get; set; } |
|
|
|
|
|
|
|
[CanBeNull] |
|
|
|
public Func<object, string> ValueConverter { get; set; } |
|
|
|
|
|
|
|
public bool Sortable { get; set; } |
|
|
|
|
|
|
|
public TableColumn() |
|
|
|
|
|
|
|
@ -608,7 +608,8 @@ public abstract class AbpCrudPageBase< |
|
|
|
yield return new TableColumn |
|
|
|
{ |
|
|
|
Title = lookupPropertyDefinition.GetLocalizedDisplayName(StringLocalizerFactory), |
|
|
|
Data = $"ExtraProperties[{propertyInfo.Name}]" |
|
|
|
Data = $"ExtraProperties[{propertyInfo.Name}]", |
|
|
|
PropertyName = propertyInfo.Name |
|
|
|
}; |
|
|
|
} |
|
|
|
else |
|
|
|
@ -616,7 +617,8 @@ public abstract class AbpCrudPageBase< |
|
|
|
var column = new TableColumn |
|
|
|
{ |
|
|
|
Title = propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory), |
|
|
|
Data = $"ExtraProperties[{propertyInfo.Name}]" |
|
|
|
Data = $"ExtraProperties[{propertyInfo.Name}]", |
|
|
|
PropertyName = propertyInfo.Name |
|
|
|
}; |
|
|
|
|
|
|
|
if (propertyInfo.IsDate() || propertyInfo.IsDateTime()) |
|
|
|
|
|
|
|
@ -105,7 +105,7 @@ |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
<DataGridColumn TItem="TItem" Field="@nameof(IHasExtraProperties.ExtraProperties)" Caption="@column.Title"> |
|
|
|
<DataGridColumn TItem="TItem" Field="@nameof(IHasExtraProperties.ExtraProperties)" SortField="@column.PropertyName" Caption="@column.Title"> |
|
|
|
<DisplayTemplate> |
|
|
|
@{ |
|
|
|
var entity = context as IHasExtraProperties; |
|
|
|
|