1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-26 09:20:26 +02:00

Updated 1.05 Drop down filter (markdown)

koalyptus 2016-08-04 16:46:10 +10:00
parent 821a0e758b
commit aefde03d1a

@ -127,4 +127,78 @@
}</code></td>
</tr>
</tbody>
</table>
## Events
<p>
Assuming <code>TableFilter</code> is already instanciated:
</p>
<pre>
var tf = new TableFilter('my-table-id');
</pre>
<table>
<thead>
<tr>
<th>Event</th>
<th>Description</th>
<th>Remarks</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<th>before-populating-filter</th>
<td>Event emitted just before starting populating a filter</td>
<td>
Subscribers receive the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>colIndex</code> - index of the filter's column</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['before-populating-filter'], function(tf, colIndex){
console.log(tf, colIndex);
});
</pre>
</td>
</tr>
<tr>
<th>after-populating-filter</th>
<td>Event emitted when the filter is populated</td>
<td>
Subscribers receive the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>colIndex</code> - index of the filter's column</li>
<li><code>element</code> - filter's DOM element</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['after-populating-filter'], function(tf, colIndex, element){
console.log(tf, colIndex, element);
});
</pre>
</td>
</tr>
<tr>
<th>filter-focus</th>
<td>Event emitted when a filter receives focus</td>
<td>
Subscribers receive the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>element</code> - filter's DOM element</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['filter-focus'], function(tf, element){
console.log(tf, element);
});
</pre>
</td>
</tr>
</tbody>
</table>