Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduced hierarchical sorting. #410

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1c0e465
refactored plugin and introduced hierarchical sorting
keyboardDrummer Oct 31, 2013
7444dc4
merged changes
keyboardDrummer Oct 31, 2013
36fd697
Merge branch 'master' of https://github.com/Mottie/tablesorter
keyboardDrummer Oct 31, 2013
aebf380
fixed missing cache for curtain tbody s bug
keyboardDrummer Oct 31, 2013
8502e79
fixed a test case
keyboardDrummer Nov 3, 2013
2294817
added a test for the childRows feature
keyboardDrummer Nov 3, 2013
598ce19
added happy flow tests for hierarchical tables
keyboardDrummer Nov 3, 2013
d2fccfd
merged from newMottieTests
keyboardDrummer Nov 3, 2013
abc6073
fixed test parser cache tests
keyboardDrummer Nov 3, 2013
d530928
fixed childRows feature
keyboardDrummer Nov 3, 2013
49189ac
fixed broken update tests and fixed addRows and updateCell methods
keyboardDrummer Nov 4, 2013
5be710e
added test case for nested tables
keyboardDrummer Nov 5, 2013
25992dc
fixed broken test
keyboardDrummer Nov 5, 2013
17bf5c4
fixed nested table problem in testing framework
keyboardDrummer Nov 5, 2013
23107af
fixed bugs related to nested tables
keyboardDrummer Nov 5, 2013
d96498e
hid testing table
keyboardDrummer Nov 5, 2013
43efb45
updated cache references in widgets.js which fixes issues with the fi…
keyboardDrummer Nov 5, 2013
0c0e130
added a test for the filter widget
keyboardDrummer Nov 6, 2013
6d314c3
Merge branch 'master' of https://github.com/steenreem/tablesorter
keyboardDrummer Nov 6, 2013
c89986c
fixed assertion count
keyboardDrummer Nov 6, 2013
b8345c4
fix cache reference in docs.js
keyboardDrummer Nov 7, 2013
40d6647
fix in comments
keyboardDrummer Nov 7, 2013
b6b1d43
added grouping test
keyboardDrummer Nov 7, 2013
a454c28
merged with newMottieTests
keyboardDrummer Nov 7, 2013
11963e8
fixed cache reference in grouping widget
keyboardDrummer Nov 7, 2013
5c1346a
fixed cache reference in beta-testing file
keyboardDrummer Nov 7, 2013
2cf72a3
temporary
keyboardDrummer Nov 8, 2013
e87a92c
worked on example page
keyboardDrummer Nov 9, 2013
621bab6
merged from mottie's master
keyboardDrummer Nov 9, 2013
230775c
fixed errors I introduced in the merge
keyboardDrummer Nov 10, 2013
d63e8ab
Merge remote-tracking branch 'mottie/master'
keyboardDrummer Nov 19, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,10 @@ pip-log.txt

# Mac crap
.DS_Store

#############
## IntelliJ
#############

*.iml
.idea/
2 changes: 1 addition & 1 deletion beta-testing/widget-column-math.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var ts = $.tablesorter = $.tablesorter || {};
$row = $el.closest('tr'),
bIndex = $tb.index( $row.closest('tbody') ),
rIndex = $tb.eq(bIndex).find('tr').index( $row ),
row = c.cache[bIndex].normalized[rIndex] || [];
row = c.cache[bIndex][rIndex].normalized || [];
if (direct) {
arry = $row.children().map(function(){
txt = (c.supportsTextContent) ? this.textContent : $(this).text();
Expand Down
28 changes: 28 additions & 0 deletions docs/css/jquery.treetable.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
table.treetable span.indenter {
display: inline-block;
margin: 0;
padding: 0;
text-align: right;

/* Disable text selection of nodes (for better D&D UX) */
user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
-webkit-user-select: none;

/* Force content-box box model for indenter (Bootstrap compatibility) */
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;

width: 19px;
}

table.treetable span.indenter a {
background-position: left center;
background-repeat: no-repeat;
display: inline-block;
text-decoration: none;
width: 19px;
}
83 changes: 83 additions & 0 deletions docs/css/jquery.treetable.theme.default.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/example-child-rows-filtered.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>jQuery plugin: Tablesorter 2.0 - Child Rows with Filter Widget</title>

<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script src="../testing/jquery-1.8.3.min.js"></script>

<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
Expand Down
2 changes: 1 addition & 1 deletion docs/example-child-rows.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>jQuery plugin: Tablesorter 2.0 - Child Rows</title>

<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script src="../testing/jquery-1.8.3.min.js"></script>

<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
Expand Down
101 changes: 101 additions & 0 deletions docs/example-tree-table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Tree Table</title>

<!-- jQuery -->
<script src="../testing/jquery-1.8.3.min.js"></script>
<script src="js/jquery.treetable.js"></script>

<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>

<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/theme.blue.css">
<link rel="stylesheet" href="css/jquery.treetable.theme.default.css">
<link rel="stylesheet" href="css/jquery.treetable.css">
<script src="../js/jquery.tablesorter.js"></script>

<!-- Tablesorter: optional -->
<script src="../addons/pager/jquery.tablesorter.pager.js"></script>

<script id="js">$(function() {

$(".tablesorter")
.tablesorter({
theme : 'blue'
})
// .tablesorterPager({
// container: $("#pager"),
// positionFixed: false
// })
.treetable({ expandable: true});;

});</script>
</head>
<body>

<div id="banner">
<h1>table<em>sorter</em></h1>
<h2>Working with Tree Tables</h2>
<h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a>
</div>

<div id="main">

<h1>Demo</h1>
<div id="demo"><table class="tablesorter">
<thead>
<tr>
<th>Name</th>
<th>Fake Population</th>
</tr>
</thead>
<tbody>
<tr data-tt-id='europe'><td>Europe</td><td>300</td></tr>
<tr data-tt-id='netherlands' data-tt-parent-id='europe'><td>Netherlands</td><td>10</td></tr>
<tr data-tt-id='molenhoek' data-tt-parent-id='netherlands'><td>Molenhoek</td><td>1</td></tr>
<tr data-tt-id='nijmegen' data-tt-parent-id='netherlands'><td>Nijmegen</td><td>2</td></tr>
<tr data-tt-id='germany' data-tt-parent-id='europe'><td>Germany</td><td>50</td></tr>
<tr data-tt-id='berlin' data-tt-parent-id='germany'><td>Berlin</td><td>8</td></tr>
<tr data-tt-id='northAmerica'><td>North America</td><td>550</td></tr>
<tr data-tt-id='us' data-tt-parent-id='northAmerica'><td>United States</td><td>450</td></tr>
<tr data-tt-id='newYork' data-tt-parent-id='us'><td>New York</td><td>5</td></tr>
<tr data-tt-id='losAngeles' data-tt-parent-id='us'><td>Los Angeles</td><td>7</td></tr>
<tr data-tt-id='canada' data-tt-parent-id='northAmerica'><td>Canada</td><td>100</td></tr>
<tr data-tt-id='toronto' data-tt-parent-id='canada'><td>Toronto</td><td>4</td></tr>
<tr data-tt-id='otawa' data-tt-parent-id='canada'><td>Otawa</td><td>3</td></tr>
<tr data-tt-id='africa'><td>Africa</td><td>500</td></tr>
<tr data-tt-id='egypt' data-tt-parent-id='africa'><td>Egypt</td><td>100</td></tr>
<tr data-tt-id='cairo' data-tt-parent-id='egypt'><td>Caïro</td><td>10</td></tr>
<tr data-tt-id='luxor' data-tt-parent-id='egypt'><td>Luxor</td><td>5</td></tr>
<tr data-tt-id='zimbabwe' data-tt-parent-id='africa'><td>Zimbabwe</td><td>90</td></tr>
<tr data-tt-id='harare' data-tt-parent-id='zimbabwe'><td>Harare</td><td>10</td></tr>
</tbody>
</table>

<!-- <div id="pager" class="pager">
<form>
<input type="button" value="&lt;&lt;" class="first" />
<input type="button" value="&lt;" class="prev" />
<input type="text" class="pagedisplay"/>
<input type="button" value="&gt;" class="next" />
<input type="button" value="&gt;&gt;" class="last" />
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
</form>
</div></div> -->

</div>

</body>
</html>
8 changes: 4 additions & 4 deletions docs/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ $(window).load(function(){
// append hidden parsed value to cell
// used by feet-inch-fraction & metric parser demos
var addParsedValues = function($t, cols, format){
var i, j, r,
var r,
$r = $t.find('tbody tr'),
c = $t[0].config.cache[0].normalized,
l = c.length - 1;
cache = $t[0].config.cache[0];
$r.each(function(i){
r = this;
var normalized = cache[i].normalized;
$.each(cols, function(v,j){
r.cells[j].innerHTML += ' <span class="val hidden removeme">(<span class="results">' + (format ? format(c[i][j]) : c[i][j]) + '</span>)</span>';
r.cells[j].innerHTML += ' <span class="val hidden removeme">(<span class="results">' + (format ? format(normalized[j]) : normalized[j]) + '</span>)</span>';
});
});

Expand Down
Loading