mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-08 17:02:30 +02:00
Updated 1.07 Rows counter (markdown)
parent
0ac61836ac
commit
dd05f701a1
|
@ -15,26 +15,49 @@
|
|||
<td>if set true, it will display the total # of rows displayed at
|
||||
the top of the table in left corner (default - false) </td>
|
||||
<td></td>
|
||||
<td><code> var tfConfig = { rows_counter: true }</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = { rows_counter: true };
|
||||
// or
|
||||
var tfConfig = {
|
||||
rows_counter: {}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>rows_counter_text</th>
|
||||
<th>text</th>
|
||||
<td>string</td>
|
||||
<td>sets text for rows counter label (default - "Data rows:
|
||||
")</td>
|
||||
<td></td>
|
||||
<td><code> var tfConfig = { rows_counter_text: "Total items:
|
||||
" }</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = {
|
||||
rows_counter: {
|
||||
text: 'Total items: '
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>from_to_text_separator</th>
|
||||
<th>separator</th>
|
||||
<td>string</td>
|
||||
<td>
|
||||
Separator symbol appearing between the first and last visible rows of
|
||||
current page when paging is enabled. ie: Rows: 31-40 / 70 (default - "-")
|
||||
</td>
|
||||
<td></td>
|
||||
<td><code> var tfConfig = { from_to_text_separator: '—' }</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = {
|
||||
rows_counter: {
|
||||
separator: '—'
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>over_text</th>
|
||||
|
@ -45,24 +68,47 @@
|
|||
enabled. ie: Rows: 31-40 / 70 (default - "/")
|
||||
</td>
|
||||
<td></td>
|
||||
<td><code> var tfConfig = { over_text: '\' }</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = {
|
||||
rows_counter: {
|
||||
over_text: '\'
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>rows_counter_target_id</th>
|
||||
<th>target_id</th>
|
||||
<td>string</td>
|
||||
<td> defines the id of the element that will contain the rows counter
|
||||
<td>Define the id of the element that will contain the rows counter
|
||||
label (default - null)</td>
|
||||
<td></td>
|
||||
<td><code>var tfConfig = { rows_counter_target_id: 'myContainerId'
|
||||
}</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = {
|
||||
rows_counter: {
|
||||
target_id: 'myContainerId'
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>tot_rows_css_class</th>
|
||||
<th>css_class</th>
|
||||
<td>string</td>
|
||||
<td>defines the css class of the rows counter label container (default
|
||||
+ 'tot')</td>
|
||||
<td></td>
|
||||
<td><code>var tfConfig = { tot_rows_css_class: 'myClass' }</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = {
|
||||
rows_counter: {
|
||||
css_class: 'myCssClass'
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>on_before_refresh_counter</th>
|
||||
|
@ -74,7 +120,17 @@
|
|||
<li>elm: DOM container element displaying rows counter</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><code>var tfConfig = { on_before_refresh_counter: function(o, elm){ alert('Rows counter is refreshed'); }}</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = {
|
||||
rows_counter: {
|
||||
on_before_refresh_counter: function(tf, elm) {
|
||||
console.log('Before rows counter is refreshed', tf, elm);
|
||||
}
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>on_after_refresh_counter</th>
|
||||
|
@ -83,12 +139,22 @@
|
|||
<td>
|
||||
note that 3 parameters are passed to the callback function:
|
||||
<ul>
|
||||
<li>o is the current TableFilter instance</li>
|
||||
<li>tf is the current TableFilter instance</li>
|
||||
<li>elm: DOM container element displaying rows counter</li>
|
||||
<li>tot: total number of filtered rows</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><code>var tfConfig = { on_after_refresh_counter: function(o, elm, tot){ alert('Total number of filtered rows: '+tot); }}</code></td>
|
||||
<td>
|
||||
<pre>
|
||||
var tfConfig = {
|
||||
rows_counter: {
|
||||
on_after_refresh_counter: function(tf, elm, tot) {
|
||||
console.log('After rows counter is refreshed', tf, elm, tot);
|
||||
}
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
Loading…
Reference in a new issue