-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix sorting of negative numeric values, fixes #392
- Loading branch information
1 parent
6ba4196
commit f2c0c7d
Showing
3 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
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,60 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="icon" type="image/svg+xml" href="../../favicon.svg"> | ||
<title>Numeric sort - simple-datatables</title> | ||
<!-- DataTable Styles --> | ||
<link rel="stylesheet" href="../dist/css/style.css"> | ||
<!-- Demo Styles --> | ||
<link rel="stylesheet" href="../demo.css"> | ||
</head> | ||
<body> | ||
<header> | ||
<h1> | ||
<a href="../../">simple-datatables</a> | ||
</h1> | ||
<a href="../../documentation">Documentation</a> | ||
<a href="../">Demos</a> | ||
</header> | ||
|
||
<h2>Data-order attributes take precedence over cell values.</h2> | ||
<p>Try sorting the two table columns.</p> | ||
<table id="reports" class="table t-table-simple table-fix js-dataTable"> | ||
<thead> | ||
<tr id="reports_Header"> | ||
<th>Name</th> | ||
<th>Variation</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td data-order="B">A</td> | ||
<td data-order="0">2000.9%</td> | ||
</tr> | ||
<tr> | ||
<td data-order="A">B</td> | ||
<td data-order="-0.5">100.3%</td> | ||
</tr> | ||
<tr> | ||
<td data-order="D">C</td> | ||
<td data-order="0.4">20%</td> | ||
</tr> | ||
<tr> | ||
<td data-order="E">D</td> | ||
<td data-order="-0.41">-7%</td> | ||
</tr> | ||
<tr> | ||
<td data-order="C">E</td> | ||
<td data-order="1.6">-9%</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<script type="module"> | ||
import {DataTable} from "../dist/module.js" | ||
|
||
window.dt = new DataTable("#reports", {}) | ||
</script> | ||
</body> | ||
</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
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