-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Steve Bourgeois
authored and
Steve Bourgeois
committed
Nov 4, 2024
1 parent
00355d6
commit 1e3ba0b
Showing
6 changed files
with
360 additions
and
30 deletions.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
méli-mélo/2024-10-datatable-utilities/datatable-utilities-doc-en.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
--- | ||
title: DataTable Utilities - Documentation | ||
language: en | ||
description: Utility to Manipulate JSON Data. | ||
tag: DataTable | ||
altLangPage: datatable-utilities-doc-fr.html | ||
dateModified: 2024-11-01 | ||
--- | ||
|
||
<div class="wb-prettify all-pre"></div> | ||
|
||
<div> | ||
<h2>Configuration options</h2> | ||
|
||
<p>Document the public configuration options that can be used by implementers or developers.</p> | ||
<p>Enable the plugin for the Target Table by adding wb-tables-utility to the <table> element <code><table class="table wb-tables wb-tables-utility"> data-wb-tables-utility="{...}"</code></p> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Option</th> | ||
<th>Description</th> | ||
<th>How to configure</th> | ||
<th>Values</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>debug</td> | ||
<td>Print Debug messages to the console</td> | ||
<td><code>data-wb-tables-utility="{&quot;debug&quot;:true}"</code></td> | ||
<td> | ||
<dl> | ||
<dt>false (default)</dt> | ||
<dd>Suppress Printing of debug messages.</dd> | ||
<dt>true</dt> | ||
<dd>Show debug messages to the console.</dd> | ||
</dl> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>filteredsum</td> | ||
<td>Column Totals to reflect Filtered DataTable Data</td> | ||
<td><code>data-wb-tables-utility="{&quot;filteredsum&quot;:false}"</code></td> | ||
<td> | ||
<dl> | ||
<dt>true (default):</dt> | ||
<dd>As Data is Filtered adjust Totals to match filtered Data.</dd> | ||
<dt>false:</dt> | ||
<dd>Show Grand Total Regardless of data filtered.</dd> | ||
</dl> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-sum</td> | ||
<td>When applied to a column, a column footer total is calcualted</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-sum", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-sum | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-money</td> | ||
<td>When this class is applied to a column, the data is manipulated to reflect currency with $</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-money", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-money | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-cur-thousand</td> | ||
<td>When this class is applied to a column, the data is manipulated to reflect currency without $</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-cur-thousand", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-cur-thousand | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-mailto</td> | ||
<td>When this class is applied to a column, the data is searched with an email partern, and when found are wrapped with <a href="mailto:...">...</a> to make it a clikcable link.</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-mailto", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-mailto | ||
</td> | ||
</tr> | ||
<tr>(column-name, column-name-url) | ||
<td>wb-col-url</td> | ||
<td>When this class is applied to a column, dataTable Utilites looks for a second column with the same name as this column that is ending with -url | ||
and the 2 are stiched into a single column wrapped with <a href="column-name-url">column-name</a> to make it a clikcable link.</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-url", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-url | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> |
96 changes: 96 additions & 0 deletions
96
méli-mélo/2024-10-datatable-utilities/datatable-utilities-doc-fr.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
title: DataTable Utilities - Documentation | ||
language: fr | ||
description: Utility to Manipulate JSON Data. | ||
tag: DataTable | ||
altLangPage: datatable-utilities-doc-fr.html | ||
dateModified: 2024-11-01 | ||
--- | ||
|
||
<div class="wb-prettify all-pre"></div> | ||
|
||
<div> | ||
<h2>Configuration options</h2> | ||
|
||
<p>Document the public configuration options that can be used by implementers or developers.</p> | ||
|
||
<p>Enable the plugin for the Target Table by adding wb-tables-utility to the <table> element <code><table class="table wb-tables wb-tables-utility"> data-wb-tables-utility="{...}"</code></p> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Option</th> | ||
<th>Description</th> | ||
<th>How to configure</th> | ||
<th>Values</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>debug</td> | ||
<td>Print Debug messages to the console</td> | ||
<td><code>data-wb-tables-utility="{&quot;debug&quot;:true}"</code></td> | ||
<td> | ||
<dl> | ||
<dt>false (default)</dt> | ||
<dd>Suppress Printing of debug messages.</dd> | ||
<dt>true</dt> | ||
<dd>Show debug messages to the console.</dd> | ||
</dl> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>filteredsum</td> | ||
<td>Column Totals to reflect Filtered DataTable Data</td> | ||
<td><code>data-wb-tables-utility="{&quot;filteredsum&quot;:false}"</code></td> | ||
<td> | ||
<dl> | ||
<dt>true (default):</dt> | ||
<dd>As Data is Filtered adjust Totals to match filtered Data.</dd> | ||
<dt>false:</dt> | ||
<dd>Show Grand Total Regardless of data filtered.</dd> | ||
</dl> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-sum</td> | ||
<td>When applied to a column, a column footer total is calcualted</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-sum", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-sum | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-money</td> | ||
<td>When this class is applied to a column, the data is manipulated to reflect currency with $</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-money", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-money | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-cur-thousand</td> | ||
<td>When this class is applied to a column, the data is manipulated to reflect currency without $</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-cur-thousand", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-cur-thousand | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>wb-col-mailto</td> | ||
<td>When this class is applied to a column, the data is searched with an email partern, and when found are wrapped with <a href="mailto:...">...</a> to make it a clikcable link.</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-mailto", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-mailto | ||
</td> | ||
</tr> | ||
<tr>(column-name, column-name-url) | ||
<td>wb-col-url</td> | ||
<td>When this class is applied to a column, dataTable Utilites looks for a second column with the same name as this column that is ending with -url | ||
and the 2 are stiched into a single column wrapped with <a href="column-name-url">column-name</a> to make it a clikcable link.</td> | ||
<td><code>"columnDefs": [{ "className": "wb-col-url", "targets": [3]}]</code></td> | ||
<td> | ||
wb-col-url | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
title: DataTable Utilities | ||
dateModified: 2024-10-01 | ||
dateModified: 2024-10-31 | ||
description: "Utilities that allow Columns to be MONEY Formatted, Emails wrapped with mailto, url's to be clickable and Footer totals that can be affected by filtered Data Or not." | ||
lang: en | ||
altLangPage: "index-fra.html" | ||
altLangPage: "index-fr.html" | ||
script: [ "js/wb-pspc-datatable-utility.js" ] | ||
css: [ "css/wb-pspc-datatable-utility.css"] | ||
--- | ||
|
@@ -30,7 +30,23 @@ <h2>GCWeb implementation plan</h2> | |
|
||
<p>Sponsor: PSPC - {{ implPlan.sponsor }}</p> | ||
|
||
<h2>Control Table with Raw Data</h2> | ||
<div class="panel panel-default"> | ||
<header class="panel-heading"> | ||
<h2 class="panel-title">On this page</h2> | ||
</header> | ||
<div class="panel-body"> | ||
<ul> | ||
<li><a href="datatable-utilities-doc-en.html">Configuration Options</a></li> | ||
<li><a href="#a1">Control Table with Raw Data</a></li> | ||
<li><a href="#a2">Column Data Manipulation Example 1</a></li> | ||
<li><a href="#a3">Column Data Manipulation Example 2</a></li> | ||
<li><a href="#a4">Table Footer With Static Totals</a></li> | ||
<li><a href="#a5">Table Footer With Dynamic Totals updated when Filtered</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<h2 id="a1">Control Table with Raw Data</h2> | ||
|
||
<div class="mrgn-bttm-lg"> | ||
<table class="wb-tables table table-striped table-hover table-condensed small" id="t1" data-wb-tables='{ "ajax":"data/datatable-utility.json", "columns": [ | ||
|
@@ -64,11 +80,11 @@ <h2>Control Table with Raw Data</h2> | |
</table> | ||
</div> | ||
|
||
<h2>Column Data Manipulation Example</h2> | ||
<h2 id="a2">Column Data Manipulation Example 1</h2> | ||
|
||
<ul> | ||
<li><code>.wb-col-mailto</code> Wrap email Addresses with a <a href="mailto:...">[email protected]</a></li> | ||
<li><code>.wb-col-money</code> Formnat numbers as Money.</li> | ||
<li><code>.wb-col-money</code> Format numbers as Money.</li> | ||
<li><code>.wb-col-url</code> Stitch 2 columns (column-name, column-name-url) into a single URL / Caption or URL and URL as the caption if (column-name-url) does not exists within the JSON File.</li> | ||
</ul> | ||
|
||
|
@@ -117,7 +133,56 @@ <h2>Column Data Manipulation Example</h2> | |
</table> | ||
</div> | ||
|
||
<h2>Table Footer With Static Totals</h2> | ||
<h2 id="a3">Column Data Manipulation Example 2</h2> | ||
|
||
<p><code>.wb-col-cur-thousand</code> Format numbers with thousands separator with 2 decimals.</p> | ||
|
||
<pre class="mrgn-bttm-lg"> | ||
<table class="wb-tables table table-striped table-hover table-condensed small <strong>wb-tables-utility</strong>" id="t3" | ||
data-wb-tables='{ "ajax":"data/datatable-utility.json", | ||
"columns": [{ "data": "DepartmentEN" }, | ||
{ "data": "ContactEmail" }, | ||
{ "data": "Custom study titleEN" }, | ||
{ "data": "Registration number" }, | ||
{ "data": "Contract value" }], | ||
"columnDefs": [{ "className": "text-left", "targets": [0]}, | ||
{ "className": "text-left", "targets": [1] }, | ||
{ "className": "text-left", "targets": [2] }, | ||
{ "className": "text-left", "targets": [3] }, | ||
{ "className": "text-right <strong>wb-col-cur-thousand</strong>", "targets": [4] }], | ||
"lengthMenu": [ [5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"] ]}'> | ||
</pre> | ||
|
||
<div class="mrgn-bttm-lg"> | ||
<table class="wb-tables table table-striped table-hover table-condensed small wb-tables-utility" id="t3" data-wb-tables='{ "ajax":"data/datatable-utility.json", "columns": [ | ||
{ "data": "DepartmentEN" }, | ||
{ "data": "ContactEmail" }, | ||
{ "data": "Custom study titleEN" }, | ||
{ "data": "Registration number" }, | ||
{ "data": "Contract value" } | ||
], | ||
"columnDefs": [{ "className": "text-left", "targets": [0]}, | ||
{ "className": "text-left", "targets": [1] }, | ||
{ "className": "text-left", "targets": [2] }, | ||
{ "className": "text-left", "targets": [3] }, | ||
{ "className": "text-right wb-col-cur-thousand", "targets": [4] }], | ||
"lengthMenu": [ [5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"] ]}'> | ||
<caption class="text-left"> | ||
Table 3: Second Example of JSON Data Manipulation | ||
</caption> | ||
<thead> | ||
<tr class="active"> | ||
<th scope="col">Department</th> | ||
<th scope="col">Contact Email</th> | ||
<th scope="col">Custom study</th> | ||
<th scope="col">Reg#</th> | ||
<th scope="col">Contract value</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
</div> | ||
|
||
<h2 id="a4">Table Footer With Static Totals</h2> | ||
|
||
<p><code>.wb-col-sum</code> class on the column to perform column Total</p> | ||
<p>Add a Placehoder <tfoot> at the bottom of the Table.</p> | ||
|
@@ -135,7 +200,7 @@ <h3>Code</h3> | |
<p>Pass <code>false</code> via filteredsum to the plugin <code>data-wb-tables-utility="{"filteredsum":false}"</code> as the default is true</p> | ||
|
||
<pre class="mrgn-bttm-lg"> | ||
<table class="wb-tables table table-striped table-hover table-condensed small <strong>wb-tables-utility</strong>" id="t3" | ||
<table class="wb-tables table table-striped table-hover table-condensed small <strong>wb-tables-utility</strong>" id="t4" | ||
<strong>data-wb-tables-utility="{"filteredsum":false}"</strong> | ||
data-wb-tables='{ "ajax":"data/datatable-utility.json", | ||
"columns": [{ "data": "DepartmentEN" }, | ||
|
@@ -152,7 +217,7 @@ <h3>Code</h3> | |
</pre> | ||
|
||
<div class="mrgn-bttm-lg"> | ||
<table class="wb-tables table table-striped table-hover table-condensed small wb-tables-utility" id="t3" data-wb-tables-utility="{"debug":true, "filteredsum":false}" data-wb-tables='{ "ajax":"data/datatable-utility.json", "columns": [ | ||
<table class="wb-tables table table-striped table-hover table-condensed small wb-tables-utility" id="t4" data-wb-tables-utility="{"debug":true, "filteredsum":false}" data-wb-tables='{ "ajax":"data/datatable-utility.json", "columns": [ | ||
{ "data": "DepartmentEN" }, | ||
{ "data": "ContactEmail" }, | ||
{ "data": "Custom study titleEN" }, | ||
|
@@ -166,7 +231,7 @@ <h3>Code</h3> | |
{ "className": "text-right wb-col-money wb-col-sum", "targets": [4] }], | ||
"lengthMenu": [ [5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"] ]}'> | ||
<caption class="text-left"> | ||
Table 3: Static Totals in Table Footer Example | ||
Table 4: Static Totals in Table Footer Example | ||
</caption> | ||
<thead> | ||
<tr class="active"> | ||
|
@@ -186,7 +251,7 @@ <h3>Code</h3> | |
</table> | ||
</div> | ||
|
||
<h2>Table Footer With Dynamic Totals updated when Filtered</h2> | ||
<h2 id="a5">Table Footer With Dynamic Totals updated when Filtered</h2> | ||
|
||
<p><code>.wb-col-sum</code> class on the column to perform column Total</p> | ||
<p>Add a Placehoder <tfoot> at the bottom of the Table.</p> | ||
|
@@ -203,7 +268,7 @@ <h2>Table Footer With Dynamic Totals updated when Filtered</h2> | |
<h3>Code</h3> | ||
|
||
<pre class="mrgn-bttm-lg"> | ||
<table class="wb-tables table table-striped table-hover table-condensed small <strong>wb-tables-utility</strong>" id="t4" | ||
<table class="wb-tables table table-striped table-hover table-condensed small <strong>wb-tables-utility</strong>" id="t5" | ||
data-wb-tables='{ "ajax":"data/datatable-utility.json", | ||
"columns": [{ "data": "DepartmentEN" }, | ||
{ "data": "ContactEmail" }, | ||
|
@@ -219,7 +284,7 @@ <h3>Code</h3> | |
</pre> | ||
|
||
<div class="mrgn-bttm-lg"> | ||
<table class="wb-tables table table-striped table-hover table-condensed small wb-tables-utility" id="t4" data-wb-tables='{ "ajax":"data/datatable-utility.json", "columns": [ | ||
<table class="wb-tables table table-striped table-hover table-condensed small wb-tables-utility" id="t5" data-wb-tables='{ "ajax":"data/datatable-utility.json", "columns": [ | ||
{ "data": "DepartmentEN" }, | ||
{ "data": "ContactEmail" }, | ||
{ "data": "Custom study titleEN" }, | ||
|
@@ -233,7 +298,7 @@ <h3>Code</h3> | |
{ "className": "text-right wb-col-money wb-col-sum", "targets": [4] }], | ||
"lengthMenu": [ [5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"] ]}'> | ||
<caption class="text-left"> | ||
Table 4: Dynamic Totals in Table Footer Example | ||
Table 5: Dynamic Totals in Table Footer Example | ||
</caption> | ||
<thead> | ||
<tr class="active"> | ||
|
Oops, something went wrong.