This PR proposes to enable using DataTables on tables rendered by other plugin (e.g. csv and structured data).
There are currently 2 issues that prevent doing so:
Substitution plugins are not rendered within a datatable container. Therefore we cannot apply DataTables on a table built by another plugin.
Even after the table is created, the 3rd party plugin may not format the table correctly (missing thead). Therefore we need either to correct each plugin we want to use, or we need a post-factory to create the thead.
What this PR does:
Adds substition allowed type. This allows substitution plugins to render their own tables.
Adds an extra option header-rows="X" in datatable opening tag, which specifies the number of top rows to be included in the table thead. Also checked on DataTables.net that this option name does not exist yet.
Looks for all tables in .dt-wrapper container (even without thead).
Creates or appends the thead according to header-rows attribute.
Creates the DataTable only if a proper thead exists after this step.
It also slightly improves the syntax (entry and exit patterns), and the javascript for retrieval of fixedHeaderOffsetTop value.
Hi,
This PR proposes to enable using DataTables on tables rendered by other plugin (e.g. csv and structured data).
There are currently 2 issues that prevent doing so:
What this PR does:
substition
allowed type. This allows substitution plugins to render their own tables.header-rows="X"
in datatable opening tag, which specifies the number of top rows to be included in the table thead. Also checked on DataTables.net that this option name does not exist yet..dt-wrapper
container (even without thead).header-rows
attribute.It also slightly improves the syntax (entry and exit patterns), and the javascript for retrieval of fixedHeaderOffsetTop value.