HtmlForgeX

API Reference

Class

DataTablesTable

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Table

Enhanced DataTables table with comprehensive feature support and fluent API.

Inheritance

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by

Accepted by parameters

Constructors

DataTablesTable 2 overloads
public DataTablesTable() #

Initializes a new instance of the DataTablesTable class.

public DataTablesTable(IEnumerable<Object> objects, TableType library) #

Initializes a new instance populated with data.

Parameters

objects System.Collections.Generic.IEnumerable{System.Object} requiredposition: 0
library HtmlForgeX.TableType requiredposition: 1

Methods

ApplyGlobalColumnDefaults(HtmlForgeX.DataTablesGlobalConfig arg1) #

Applies global column defaults to all columns in the table.

Parameters

arg1 HtmlForgeX.DataTablesGlobalConfig required
ApplyGlobalConfiguration() #

Applies global configuration settings to this table.

ApplyGlobalDefaultsToColumn(HtmlForgeX.DataTablesColumn arg1, HtmlForgeX.DataTablesGlobalConfig arg2) #

Applies global defaults to a single column configuration.

Parameters

arg1 HtmlForgeX.DataTablesColumn required
arg2 HtmlForgeX.DataTablesGlobalConfig required
BuildHtmlTable() #

Builds traditional HTML table with DataTables initialization.

BuildInitializationScript() #

Builds the DataTables initialization script.

BuildJavaScriptInitializationScript() #

Builds the JavaScript initialization script with data source.

BuildJavaScriptTable() #

Builds JavaScript-rendered table for better performance.

public override String BuildTable() #
Returns: String

Builds the final table markup including initialization script.

BuildToggleViewModeInit(System.String arg1) #

Builds the small IIFE that determines initial toggle view mode and adjusts config accordingly.

Parameters

arg1 System.String required
public DataTablesTable Configure(Action<DataTablesOptions> configure) #
Returns: DataTablesTable
EditorBrowsable(2)

Apply comprehensive DataTables configuration.

Parameters

configure System.Action{HtmlForgeX.DataTablesOptions} requiredposition: 0
public DataTablesTable ConfigureColumns(Action<DataTablesColumnBuilder> configure) #
Returns: DataTablesTable

Configure columns with fluent API.

Parameters

configure System.Action{HtmlForgeX.DataTablesColumnBuilder} requiredposition: 0
public DataTablesTable ConfigureExport(Action<DataTablesExportBuilder> configure) #
Returns: DataTablesTable
EditorBrowsable(2)

Configure export options with fluent API.

Parameters

configure System.Action{HtmlForgeX.DataTablesExportBuilder} requiredposition: 0
public DataTablesTable ConfigureSearchBuilder(Action<DataTablesSearchBuilderBuilder> configure) #
Returns: DataTablesTable
EditorBrowsable(2)

Configures the SearchBuilder extension using the fluent builder API.

Parameters

configure System.Action{HtmlForgeX.DataTablesSearchBuilderBuilder} requiredposition: 0
Delegate that defines SearchBuilder options.

Returns

The table instance for chaining.

public DataTablesTable ConstrainToContainer(Boolean enable = true) #
Returns: DataTablesTable
EditorBrowsable(2)

Constrains the table to its container by wrapping it in a viewport div (overflow-x:auto). Enabled by default for robust behavior inside accordions and narrow containers.

Parameters

enable System.Boolean = true optionalposition: 0
DefaultOrder 2 overloads
public DataTablesTable DefaultOrder(Int32 columnIndex, String direction = "asc") #
Returns: DataTablesTable

Set default column ordering.

Parameters

columnIndex System.Int32 requiredposition: 0
direction System.String = "asc" optionalposition: 1
public DataTablesTable DefaultOrder(params ValueTuple<Int32, String>[] orders) #
Returns: DataTablesTable

Set multiple column ordering.

Parameters

orders System.ValueTuple{System.Int32,System.String}[] requiredposition: 0
DetermineAutoRenderMode() #

Determines render mode automatically based on data size.

public DataTablesTable DisablePaging() #
Returns: DataTablesTable

Disable paging.

public DataTablesTable DisableSearchHighlighter() #
Returns: DataTablesTable
EditorBrowsable(2)

Disable highlighting of active search terms inside table cells.

public DataTablesTable DisableSearching() #
Returns: DataTablesTable
EditorBrowsable(2)

Disable searching.

public DataTablesTable DomLayout(String dom) #
Returns: DataTablesTable
EditorBrowsable(2)

Set DOM layout string.

Parameters

dom System.String requiredposition: 0
public DataTablesTable EnableAutoRendering() #
Returns: DataTablesTable
EditorBrowsable(2)

Enable automatic rendering mode selection based on data size.

public DataTablesTable EnableExport(params DataTablesExportFormat[] formats) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable export functionality with specified formats.

Parameters

formats HtmlForgeX.DataTablesExportFormat[] requiredposition: 0
public DataTablesTable EnableFixedColumns(Int32 leftColumns = 0, Int32 rightColumns = 0) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable fixed columns.

Parameters

leftColumns System.Int32 = 0 optionalposition: 0
rightColumns System.Int32 = 0 optionalposition: 1
public DataTablesTable EnableFixedHeader(Int32 headerOffset = 0, Boolean footer = false) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable fixed header.

Parameters

headerOffset System.Int32 = 0 optionalposition: 0
footer System.Boolean = false optionalposition: 1
public DataTablesTable EnableHtmlRendering() #
Returns: DataTablesTable
EditorBrowsable(2)

Enable HTML rendering (traditional mode).

public DataTablesTable EnableJavaScriptRendering() #
Returns: DataTablesTable
EditorBrowsable(2)

Enable JavaScript rendering for better performance.

public DataTablesTable EnableOrdering(Boolean enabled = true) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable column ordering.

Parameters

enabled System.Boolean = true optionalposition: 0
public DataTablesTable EnablePaging(Int32 pageLength = 10, Int32[] lengthMenu = null) #
Returns: DataTablesTable

Enable paging with optional configuration.

Parameters

pageLength System.Int32 = 10 optionalposition: 0
lengthMenu System.Int32[] = null optionalposition: 1
EnableResponsive 2 overloads
public DataTablesTable EnableResponsive(Action<DataTablesResponsiveOptions> configure) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable responsive design.

Parameters

enabled System.Boolean = true requiredposition: 0
EnableResponsive(System.Action{HtmlForgeX.DataTablesResponsiveOptions} configure) #

Enable responsive design with typed options.

Parameters

configure System.Action{HtmlForgeX.DataTablesResponsiveOptions} required
public DataTablesTable EnableRowGrouping(Int32 columnIndex, Action<DataTablesRowGroup> configure = null) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable row grouping.

Parameters

columnIndex System.Int32 requiredposition: 0
configure System.Action{HtmlForgeX.DataTablesRowGroup} = null optionalposition: 1
public DataTablesTable EnableSearchBuilder(Action<DataTablesSearchBuilder> configure = null) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable search builder.

Parameters

configure System.Action{HtmlForgeX.DataTablesSearchBuilder} = null optionalposition: 0
public DataTablesTable EnableSearchHighlighter(Action<DataTablesSearchHighlighterConfig> configure = null) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable highlighting of active search terms inside table cells.

Parameters

configure System.Action{HtmlForgeX.DataTablesSearchHighlighterConfig} = null optionalposition: 0
public DataTablesTable EnableSearching(Boolean global = true) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable searching with optional configuration.

Parameters

global System.Boolean = true optionalposition: 0
public DataTablesTable EnableSearchPanes(Action<DataTablesSearchPanes> configure = null) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable search panes.

Parameters

configure System.Action{HtmlForgeX.DataTablesSearchPanes} = null optionalposition: 0
EnableSelection 2 overloads
public DataTablesTable EnableSelection(DataTablesSelectStyle style = Single) #
Returns: DataTablesTable

Enable row selection.

Parameters

style HtmlForgeX.DataTablesSelectStyle = Single optionalposition: 0
public DataTablesTable EnableSelection(String style) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable row selection with a raw DataTables Select style.

Parameters

style System.String requiredposition: 0
public DataTablesTable EnableServerSide(Action<DataTablesAjax> configure = null) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable server-side processing with Ajax configuration.

Parameters

configure System.Action{HtmlForgeX.DataTablesAjax} = null optionalposition: 0
public DataTablesTable EnableStateSaving(Boolean enabled = true) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable state saving.

Parameters

enabled System.Boolean = true optionalposition: 0
EnsureColumnsFromSharedData() #

When a table declares it will use shared data but doesn't have local rows, infer column headers and a basic columns mapping from the shared dataset so DataTables can bind object rows correctly.

EnsureResponsiveControlColumn() #

When Responsive mode is set to use a control column, ensure the first column is annotated appropriately (class 'dtr-control', not orderable). This avoids requiring users to set classes manually in examples.

public DataTablesTable Feature(DataTablesFeature feature, Boolean enabled = true) #
Returns: DataTablesTable
EditorBrowsable(2)

Enable or disable specific DataTables features.

Parameters

feature HtmlForgeX.DataTablesFeature requiredposition: 0
enabled System.Boolean = true optionalposition: 1
GetEffectiveRenderMode() #

Determines the effective rendering mode for this table.

public DataTablesTable Highlight(Action<DataTablesHighlighterBuilder> configure) #
Returns: DataTablesTable

Adds column-highlighting rules using a fluent builder.

Parameters

configure System.Action{HtmlForgeX.DataTablesHighlighterBuilder} requiredposition: 0
public DataTablesTable HighlightAssertions(String successColumn = "Success", String statusColumn = "Status", Boolean highlightParent = false) #
Returns: DataTablesTable
EditorBrowsable(2) Obsolete("Use HighlightOutcomes or the generic HighlightBoolean/HighlightByStatus.")

Backward-compatible wrapper for the previous name. Prefer DataTablesStatusHighlightOptions).

Parameters

successColumn System.String = "Success" optionalposition: 0
statusColumn System.String = "Status" optionalposition: 1
highlightParent System.Boolean = false optionalposition: 2
public DataTablesTable HighlightBoolean(String column, Action<TargetsBuilder> whenTrue, Action<TargetsBuilder> whenFalse, Boolean highlightParentOnFalse = false) #
Returns: DataTablesTable

Generic: highlight a boolean column with separate styles for true/false.

Parameters

column System.String requiredposition: 0
whenTrue System.Action{HtmlForgeX.TargetsBuilder} requiredposition: 1
whenFalse System.Action{HtmlForgeX.TargetsBuilder} requiredposition: 2
highlightParentOnFalse System.Boolean = false optionalposition: 3
public DataTablesTable HighlightByStatus(String statusColumn, IDictionary<String, Action<TargetsBuilder>> map, Boolean caseInsensitive = true) #
Returns: DataTablesTable

Generic: highlight by mapping status strings to styles.

Parameters

statusColumn System.String requiredposition: 0
map System.Collections.Generic.IDictionary{System.String,System.Action{HtmlForgeX.TargetsBuilder}} requiredposition: 1
caseInsensitive System.Boolean = true optionalposition: 2
public DataTablesTable HighlightOutcomes(DataTablesStatusHighlightOptions options = null) #
Returns: DataTablesTable

Convenience: highlight typical outcome columns using a configurable options object.

Parameters

options HtmlForgeX.DataTablesStatusHighlightOptions = null optionalposition: 0
public DataTablesTable HighlightWhen(Action<ConditionGroupBuilder> where, Action<TargetsBuilder> then, Action<TargetsBuilder> elseTargets = null) #
Returns: DataTablesTable

Convenience for adding a single rule.

Parameters

where System.Action{HtmlForgeX.ConditionGroupBuilder} requiredposition: 0
then System.Action{HtmlForgeX.TargetsBuilder} requiredposition: 1
elseTargets System.Action{HtmlForgeX.TargetsBuilder} = null optionalposition: 2
InitializeDefaults() #

Initialize default settings.

public DataTablesTable Localize(Action<DataTablesLanguage> configure) #
Returns: DataTablesTable
EditorBrowsable(2)

Set localization options.

Parameters

configure System.Action{HtmlForgeX.DataTablesLanguage} requiredposition: 0
OnAddedToDocument() #

Ensure deferred data is loaded and post-configuration (like hiding columns by name) is applied once the table is attached to the document.

public DataTablesTable PagingType(DataTablesPagingType type) #
Returns: DataTablesTable
EditorBrowsable(2)

Set pagination type.

Parameters

type HtmlForgeX.DataTablesPagingType requiredposition: 0
PrepareConfiguration() #

Prepares the configuration object for DataTables initialization.

PrepareDataSource() #

Prepares data source for JavaScript rendering.

RegisterFeatureLibraries() #

Registers libraries for specific features that are enabled.

RegisterLibraries() #

Registers the required libraries for DataTables based on features used.

public DataTablesTable Scrolling(String scrollY = null, Boolean scrollX = false, Boolean scrollCollapse = false) #
Returns: DataTablesTable
EditorBrowsable(2)

Configure scrolling options.

Parameters

scrollY System.String = null optionalposition: 0
scrollX System.Boolean = false optionalposition: 1
scrollCollapse System.Boolean = false optionalposition: 2
public DataTablesTable SetRenderMode(DataTablesRenderMode mode) #
Returns: DataTablesTable
EditorBrowsable(2)

Set the rendering mode for this table.

Parameters

mode HtmlForgeX.DataTablesRenderMode requiredposition: 0
public DataTablesTable Settings(Action<DataTablesSettings> configure) #
Returns: DataTablesTable

Groups less-common options under a single fluent entry point to keep IntelliSense lean.

Parameters

configure System.Action{HtmlForgeX.DataTablesSettings} requiredposition: 0
public DataTablesTable Style(BootStrapTableStyle style) #
Returns: DataTablesTable

Add a bootstrap table style.

Parameters

style HtmlForgeX.BootStrapTableStyle requiredposition: 0
public DataTablesTable Surface(TablerSurfaceStyle style) #
Returns: DataTablesTable
EditorBrowsable(2)

Applies a shared surface treatment to the table viewport shell.

Parameters

style HtmlForgeX.TablerSurfaceStyle requiredposition: 0
SyncColumnTitlesWithHeaders() #

If column definitions exist already (e.g., created during ApplyGlobalColumnDefaults), update their Title to match the possibly transformed headers so JS mode and DOM agree.

Properties

public List<BootStrapTableStyle> StyleList { get; set; } #

List of table styles to apply.

public DataTablesOptions Options { get; } #

DataTables configuration options.

public Nullable<DataTablesRenderMode> RenderMode { get; set; } #

Rendering mode for this table (overrides global setting if set)

Fields

public String Id #

Gets the table identifier.

_features #

Feature toggles for DataTables functionality.

_columns #

Column configurations.

_exportButtons #

Export button configurations.

_dataSource #

Data source for JavaScript rendering

_useViewportWrapper #

Wrap in a viewport div to confine horizontal overflow to the component.

_lazyInit #

When true, defer DataTables initialization until the table is visible. If null, uses document default.

_toggleViewRequested #

Whether to add a ToggleView button.

_columnFiltersPlacement #

Placement for per-column filters.

_pageLengthPlacement #

Placement for the native page-length selector when HtmlForgeX manages the layout.

_pagingPlacement #

Placement for native pagination buttons when HtmlForgeX manages the layout.

_pageLengthLabelMode #

Label style for the native page-length selector.

_alphabetFilter #

Alphabet toolbar filter configuration.

Extension Methods

public static DataTablesTable AnalyticsSetup(DataTablesTable table, Int32 groupByColumn = -1, String searchPanesLayout = "columns-3") #
Returns: DataTablesTable

Analytics setup with search panes and grouping

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
groupByColumn System.Int32 = -1 optionalposition: 1
searchPanesLayout System.String = "columns-3" optionalposition: 2
public static DataTablesTable DashboardSetup(DataTablesTable table, Boolean enableExports = false, String scrollHeight = "300px") #
Returns: DataTablesTable

Dashboard setup for summary tables

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
enableExports System.Boolean = false optionalposition: 1
scrollHeight System.String = "300px" optionalposition: 2
public static DataTablesTable EnterpriseSetup(DataTablesTable table, Int32 pageLength = 25, Boolean enableRowGrouping = false, Int32 groupByColumn = 0) #
Returns: DataTablesTable

Enterprise setup with all advanced features

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
pageLength System.Int32 = 25 optionalposition: 1
enableRowGrouping System.Boolean = false optionalposition: 2
groupByColumn System.Int32 = 0 optionalposition: 3
public static DataTablesTable MobileOptimized(DataTablesTable table, Int32 pageLength = 5) #
Returns: DataTablesTable

Mobile-optimized setup

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
pageLength System.Int32 = 5 optionalposition: 1
public static DataTablesTable PerformanceSetup(DataTablesTable table, String scrollHeight = "500px", Boolean serverSide = false) #
Returns: DataTablesTable

Performance setup for large datasets

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
scrollHeight System.String = "500px" optionalposition: 1
serverSide System.Boolean = false optionalposition: 2
public static DataTablesTable QuickSetup(DataTablesTable table, Int32 pageLength = 10, Boolean enableExports = true, Boolean enableSearch = true, Boolean responsive = true) #
Returns: DataTablesTable

Quick setup for common DataTables configurations

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
pageLength System.Int32 = 10 optionalposition: 1
enableExports System.Boolean = true optionalposition: 2
enableSearch System.Boolean = true optionalposition: 3
responsive System.Boolean = true optionalposition: 4
public static DataTablesTable ReportSetup(DataTablesTable table, String reportTitle = "Data Report", String filename = "report") #
Returns: DataTablesTable

Report setup with comprehensive export options

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
reportTitle System.String = "Data Report" optionalposition: 1
filename System.String = "report" optionalposition: 2
public static DataTablesTable UseStandardFlattening(DataTablesTable table, Action<DataTablesSettings> configure = null) #
Returns: DataTablesTable

Enables a standard value-flattening pipeline for POCO and PSObject input. - Adds PsObjectRowTransformer to unwrap PSObject.BaseObject via reflection. - Summarizes enumerables in cells (default Count) with safe probing limits. - Optional configure hook to adjust summary behavior (FirstN, JoinStrings, etc.).

Parameters

table HtmlForgeX.DataTablesTable requiredposition: 0
configure System.Action{HtmlForgeX.DataTablesSettings} = null optionalposition: 1