Added assets + dependencies

This commit is contained in:
Bill Zimmerman
2015-02-25 14:08:14 +01:00
parent cb37f12f56
commit d5678d622e
748 changed files with 154165 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="responsive">
<name>responsive.index()</name>
<summary>Obtain the cell index from a `-tag li` details element</summary>
<since>1.0.3</since>
<type type="function">
<signature>responsive.index( li )</signature>
<description>Calculate the cell index from a `-tag li` details element</description>
<parameter type="node|jQuery" name="li">
The `-tag li` node (or a jQuery collection containing the node) to get the cell index for.
</parameter>
<returns type="object">Cell object that contains the properties `row` and `column`. This object can be used as a DataTables `dt-type cell-selector`.</returns>
</type>
<description>
When working with Responsive's details rows it can often be useful to obtain a reference to the cell, row or column that the data shown in the details row comes from. This method provides that ability, returning an object that can be used as a `dt-type cell-selector` with the `dt-api cell()` method.
Note that this method requires the default renderer to be used for `r-init responsive.details.renderer`. If a custom method is used it will not be able to obtain the information required to calculate the indexes.
</description>
<example title="Add a class name to the host cell for data when clicked on"><![CDATA[
var table = $('#example').DataTable();
$('#example').on( 'click', 'li', function () {
var cellIndx = table.responsive.index( this );
$( table.cell( cellIndex ).node() )
.addClass( 'highlight' );
} );
]]></example>
</dt-api>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="responsive">
<name>responsive.recalc()</name>
<summary>Recalculate the widths used by responsive after a change in the display</summary>
<since>1.0.1</since>
<type type="function">
<signature>responsive.recalc()</signature>
<description>Recalculate the widths used by responsive after a change in the display</description>
<returns type="DataTables.Api">DataTables API instance with the cached data for each selected cell in the result set</returns>
</type>
<description>
If a table is initialised while it is hidden (i.e. `display: none`) the browser will not calculate the width of columns (since the non-displayed element has no width!). As such, Responsive's calculations for which columns to show at the various widths will be incorrect in this situation.
To resolve this problem, this method is made available to trigger a recalculation of the column widths used by Responsive. Call it once the table is made visible to have Responsive display correctly.
It is worth noting that in many ways this method is similar to `dt-api columns.adjust()` and you will likely wish to use both together (see examples below).
</description>
<example title="Recalculate the responsive actions once the table is made visible"><![CDATA[
var table = $('#example').DataTable();
$('#example').css( 'display', 'table' );
table.responsive.recalc();
]]></example>
<example title="Use `columns.adjust()` and `responsive.recalc()`"><![CDATA[
$('#example').DataTable()
.columns.adjust()
.responsive.recalc();
]]></example>
</dt-api>