Class TableColumnModel<T, TKey>
- Namespace
- Htmx.Components.Table.Models
- Assembly
- Htmx.Components.dll
Represents a table column model that provides configuration and behavior for displaying and editing entity data in a table.
public class TableColumnModel<T, TKey> : ITableColumnModel where T : class
Type Parameters
T
The entity type that this column operates on.
TKey
The key type for the entity.
- Inheritance
-
TableColumnModel<T, TKey>
- Implements
- Inherited Members
- Extension Methods
Properties
ActionsFactories
Gets or sets a collection of factory functions that generate action models for table rows.
public List<Func<TableRowContext<T, TKey>, Task<IEnumerable<ActionModel>>>> ActionsFactories { get; set; }
Property Value
- List<Func<TableRowContext<T, TKey>, Task<IEnumerable<ActionModel>>>>
CellEditPartialView
Gets or sets the custom partial view for rendering the cell in edit mode.
public string? CellEditPartialView { get; set; }
Property Value
CellPartialView
Gets or sets the custom partial view for rendering the cell content.
public string? CellPartialView { get; set; }
Property Value
ColumnType
Gets or sets the type of column (value selector or display).
public ColumnType ColumnType { get; set; }
Property Value
DataName
Gets or sets the data property name that this column represents.
public string DataName { get; set; }
Property Value
Filter
Gets or sets a delegate that extends filtering of a IQueryable<T> using a single value comparison.
public Func<IQueryable<T>, string, IQueryable<T>>? Filter { get; set; }
Property Value
- Func<IQueryable<T>, string, IQueryable<T>>
FilterPartialView
Gets or sets the custom partial view for rendering the filter control.
public string? FilterPartialView { get; set; }
Property Value
Filterable
Gets or sets whether this column can be filtered.
public bool Filterable { get; set; }
Property Value
Header
Gets or sets the display header text for the column.
public string Header { get; set; }
Property Value
Id
Gets the unique identifier for this column.
public string Id { get; }
Property Value
IsEditable
Gets or sets whether this column can be edited inline.
public bool IsEditable { get; set; }
Property Value
ModelHandler
Gets or sets the model handler responsible for data operations on the entity type.
public ModelHandler<T, TKey> ModelHandler { get; set; }
Property Value
- ModelHandler<T, TKey>
RangeFilter
Gets or sets a delegate that extends filtering of a IQueryable<T> using a two value range comparison.
public Func<IQueryable<T>, string, string, IQueryable<T>>? RangeFilter { get; set; }
Property Value
- Func<IQueryable<T>, string, string, IQueryable<T>>
SelectorExpression
Gets or sets the expression used to select the property value for this column. Used for referencing a member of T when working with IQueryable<T>.
public Expression<Func<T, object>> SelectorExpression { get; set; }
Property Value
- Expression<Func<T, object>>
SelectorFunc
Gets or sets the compiled function used to extract values from instances of T when rendering cells.
public Func<T, object> SelectorFunc { get; set; }
Property Value
Sortable
Gets or sets whether this column can be sorted.
public bool Sortable { get; set; }
Property Value
Table
Gets or sets the reference to the parent table model.
public ITableModel Table { get; set; }
Property Value
Methods
GetActionsAsync(ITableRowContext)
Gets the available actions for a specific row in this column.
public Task<IEnumerable<ActionModel>> GetActionsAsync(ITableRowContext rowContext)
Parameters
rowContext
ITableRowContextThe context of the row to get actions for.
Returns
- Task<IEnumerable<ActionModel>>
A collection of action models for the row.
GetSerializedValue(ITableRowContext)
Gets the serialized string representation of the column value for the given row.
public string GetSerializedValue(ITableRowContext rowContext)
Parameters
rowContext
ITableRowContextThe row context to get the serialized value from.
Returns
- string
The serialized column value.
GetValue(ITableRowContext)
Extracts the value for this column from the given row context.
public object GetValue(ITableRowContext rowContext)
Parameters
rowContext
ITableRowContextThe row context to extract the value from.
Returns
- object
The column value for the specified row.