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

Updated 1.02 Main features (markdown)

koalyptus 2016-06-04 18:35:11 +10:00
parent 70458f05d4
commit c84fea4ab7

@ -312,6 +312,7 @@
</tr>
</tbody>
</table>
## Events
<p>
Assuming <code>TableFilter</code> is already instanciated:
@ -382,5 +383,274 @@ var tf = new TableFilter('my-table-id');
</pre>
</td>
</tr>
<tr>
<th>before-filtering</th>
<td>Event emitted just before the filtering process starts</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['before-filtering'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
<tr>
<th>after-filtering</th>
<td>Event emitted just after the filtering process is completed</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>searchArgs</code> - current search arguments</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['after-filtering'], function(tf, searchArgs){
console.log(tf, searchArgs);
});
</pre>
</td>
</tr>
<tr>
<th>cell-processed</th>
<td>Event emitted after a cell is processed by the filtering process</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>colIndex</code> - current column index</li>
<li><code>cell</code> - current cell DOM element</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['cell-processed'], function(tf, colIndex, cell){
console.log(tf, colIndex, cell);
});
</pre>
</td>
</tr>
<tr>
<th>row-processed</th>
<td>Event emitted after a row is processed by the filtering process</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>rowIndex</code> - current row index</li>
<li><code>validRowsIndex</code> - current validRows array index</li>
<li><code>isValid</code> - current row matches filters search terms</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['row-processed'], function(tf, rowIndex, validRowsIndex, isValid){
console.log(tf, rowIndex, validRowsIndex, isValid);
});
</pre>
</td>
</tr>
<tr>
<th>row-validated</th>
<td>
Event emitted after a row is validated by the filtering process, that is,
when a row matches the search terms
</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>rowIndex</code> - current row index</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['row-processed'], function(tf, rowIndex){
console.log(tf, rowIndex);
});
</pre>
</td>
</tr>
<tr>
<th>before-clearing-filters</th>
<td>Event emitted just before the filters are cleared</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['before-clearing-filters'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
<tr>
<th>after-clearing-filters</th>
<td>Event emitted just after the filters are cleared</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['after-clearing-filters'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
<tr>
<th>filter-focus</th>
<td>Event emitted when a <code>input</code> filter type receives focus</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>elm</code> - current filter DOM element</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['filter-focus'], function(tf, elm){
console.log(tf, elm);
});
</pre>
</td>
</tr>
<tr>
<th>filter-blur</th>
<td>Event emitted when a <code>input</code> filter type looses focus</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>elm</code> - current filter DOM element</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['filter-blur'], function(tf, elm){
console.log(tf, elm);
});
</pre>
</td>
</tr>
<tr>
<th>filters-row-inserted</th>
<td>Event emitted after the filters row is inserted into the table's headers</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
<li><code>fltRow</code> - current row DOM element containing the filters</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['filters-row-inserted'], function(tf, fltRow){
console.log(tf, fltRow);
});
</pre>
</td>
</tr>
<tr>
<th>before-loading-extensions</th>
<td>Event emitted just before extensions are being asynchronously loaded</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['before-loading-extensions'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
<tr>
<th>after-loading-extensions</th>
<td>Event emitted just after loading the extensions</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['after-loading-extensions'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
<tr>
<th>before-loading-themes</th>
<td>Event emitted just before the required stylesheets are being asynchronously loaded</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['before-loading-themes'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
<tr>
<th>after-loading-themes</th>
<td>Event emitted just after loading the required stylesheets</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['after-loading-themes'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
<tr>
<th>destroy</th>
<td>Event emitted when <code>TableFilter</code> instance is destroyed</td>
<td>
Subscribers receives the following parameters:
<ul>
<li><code>tf</code> - current TableFilter instance</li>
</ul>
</td>
<td>
<pre>
tf.emitter.on(['destroy'], function(tf){
console.log(tf);
});
</pre>
</td>
</tr>
</tbody>
</table>