-
-
Notifications
You must be signed in to change notification settings - Fork 440
Expand file tree
/
Copy pathchildRow.xml
More file actions
54 lines (47 loc) · 1.42 KB
/
Copy pathchildRow.xml
File metadata and controls
54 lines (47 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8" ?>
<dt-event>
<name>childRow</name>
<summary>A child row has been added or removed from the table</summary>
<since>1.11</since>
<type type="function">
<signature>function( e, show, row )</signature>
<parameter type="object" name="e">
Event object
</parameter>
<parameter type="boolean" name="show">
Boolean, `true` if row is being shown, `false` if not.
</parameter>
<parameter type="DataTables Api" name="row">
The parent row instance that the child row is being displayed for.
</parameter>
<scope>HTML table element</scope>
<bubbles>No</bubbles>
</type>
<description>
The `-event childRow` is triggered whenever a child row is inserted or removed from the table.
Please note that, as with all DataTables emitted events, the event object has a DataTables API instance available on it in the `dt` property.
</description>
<example title="Notification on child row display change"><![CDATA[
let table = new DataTable('#myTable', {
ajax: '../ajax/data/objects.txt',
rowId: 'id',
stateSave: true,
columns: [
{
className: 'dt-control',
orderable: false,
data: null,
defaultContent: ''
},
{ data: 'name' },
{ data: 'position' },
{ data: 'office' },
{ data: 'salary' }
],
order: [[1, 'asc']]
});
table.on('childRow', function (e, show, row) {
console.log((show ? 'Showing ' : 'Hiding ') + 'row ' + row.index());
});
]]></example>
</dt-event>