mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
added footerRow and footerCells to themes
This commit is contained in:
parent
7a28b694d8
commit
d7f2891a67
BIN
README.markdown
BIN
README.markdown
Binary file not shown.
@ -20,7 +20,7 @@
|
||||
<script src="../js/jquery.tablesorter.widgets.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<link rel="stylesheet" href="../addons/pager/jquery.tablesorter.pager.css"> <!-- -->
|
||||
<link rel="stylesheet" href="../addons/pager/jquery.tablesorter.pager.css">
|
||||
<script src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
|
||||
<script id="js">$(function() {
|
||||
@ -28,17 +28,19 @@
|
||||
$.extend($.tablesorter.themes.bootstrap, {
|
||||
// these classes are added to the table. To see other table classes available,
|
||||
// look here: http://twitter.github.com/bootstrap/base-css.html#tables
|
||||
table : 'table table-bordered table-striped',
|
||||
header : 'bootstrap-header', // give the header a gradient background
|
||||
icons : '', // add "icon-white" to make them white; this icon class is added to the <i> in the header
|
||||
sortNone : 'bootstrap-icon-unsorted',
|
||||
sortAsc : 'icon-chevron-up',
|
||||
sortDesc : 'icon-chevron-down',
|
||||
active : '', // applied when column is sorted
|
||||
hover : '', // use custom css here - bootstrap class may not override it
|
||||
filterRow: '', // filter row class
|
||||
even : '', // odd row zebra striping
|
||||
odd : '' // even row zebra striping
|
||||
table : 'table table-bordered table-striped',
|
||||
header : 'bootstrap-header', // give the header a gradient background
|
||||
footerRow : '',
|
||||
footerCells: '',
|
||||
icons : '', // add "icon-white" to make them white; this icon class is added to the <i> in the header
|
||||
sortNone : 'bootstrap-icon-unsorted',
|
||||
sortAsc : 'icon-chevron-up',
|
||||
sortDesc : 'icon-chevron-down',
|
||||
active : '', // applied when column is sorted
|
||||
hover : '', // use custom css here - bootstrap class may not override it
|
||||
filterRow : '', // filter row class
|
||||
even : '', // odd row zebra striping
|
||||
odd : '' // even row zebra striping
|
||||
});
|
||||
|
||||
// call the tablesorter plugin and apply the uitheme widget
|
||||
|
@ -13,9 +13,6 @@
|
||||
<script src="js/chili/recipes.js"></script>
|
||||
<script src="js/docs.js"></script>
|
||||
|
||||
<!-- theme switcher -->
|
||||
<script src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
|
||||
|
||||
<!-- Tablesorter: required; also include any of the jQuery UI themes -->
|
||||
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css">
|
||||
<link rel="stylesheet" href="../css/theme.jui.css">
|
||||
@ -31,17 +28,19 @@
|
||||
// Extend the themes to change any of the default class names ** NEW **
|
||||
$.extend($.tablesorter.themes.jui, {
|
||||
// change default jQuery uitheme icons - find the full list of icons here: http://jqueryui.com/themeroller/ (hover over them for their name)
|
||||
table : 'ui-widget ui-widget-content ui-corner-all', // table classes
|
||||
header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
|
||||
icons : 'ui-icon', // icon class added to the <i> in the header
|
||||
sortNone : 'ui-icon-carat-2-n-s',
|
||||
sortAsc : 'ui-icon-carat-1-n',
|
||||
sortDesc : 'ui-icon-carat-1-s',
|
||||
active : 'ui-state-active', // applied when column is sorted
|
||||
hover : 'ui-state-hover', // hover class
|
||||
filterRow: '',
|
||||
even : 'ui-widget-content', // odd row zebra striping
|
||||
odd : 'ui-state-default' // even row zebra striping
|
||||
table : 'ui-widget ui-widget-content ui-corner-all', // table classes
|
||||
header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
|
||||
footerRow : '',
|
||||
footerCells: '',
|
||||
icons : 'ui-icon', // icon class added to the <i> in the header
|
||||
sortNone : 'ui-icon-carat-2-n-s',
|
||||
sortAsc : 'ui-icon-carat-1-n',
|
||||
sortDesc : 'ui-icon-carat-1-s',
|
||||
active : 'ui-state-active', // applied when column is sorted
|
||||
hover : 'ui-state-hover', // hover class
|
||||
filterRow : '',
|
||||
even : 'ui-widget-content', // odd row zebra striping
|
||||
odd : 'ui-state-default' // even row zebra striping
|
||||
});
|
||||
|
||||
// call the tablesorter plugin and apply the ui theme widget
|
||||
@ -63,18 +62,6 @@
|
||||
|
||||
});</script>
|
||||
|
||||
<style>
|
||||
#switcher { display: inline-block; padding-bottom: 5px; }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
// Theme switcher
|
||||
// ********************
|
||||
$('#switcher').themeswitcher();
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
@ -976,14 +976,14 @@
|
||||
</td>
|
||||
<td><a href="example-option-sortreset-sortrestart.html">Example</a></td>
|
||||
</tr>
|
||||
|
||||
<tr id="sortResetKey">
|
||||
<td>sortResetKey</td>
|
||||
<td>String</td>
|
||||
<td>"ctrlKey"</td>
|
||||
<td>The key used to reset sorting on the entire table. Defaults to the control key. The other options are <code>"shiftKey"</code> or <code>"altKey"</code>. Reference: <a class="external" href="https://developer.mozilla.org/en/DOM/MouseEvent">https://developer.mozilla.org/en/DOM/MouseEvent</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr id="sortResetKey">
|
||||
<td>sortResetKey</td>
|
||||
<td>String</td>
|
||||
<td>"ctrlKey"</td>
|
||||
<td>The key used to reset sorting on the entire table. Defaults to the control key. The other options are <code>"shiftKey"</code> or <code>"altKey"</code>. Reference: <a class="external" href="https://developer.mozilla.org/en/DOM/MouseEvent">https://developer.mozilla.org/en/DOM/MouseEvent</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr id="sortrestart">
|
||||
<td><span class="permalink">sortRestart</span></td>
|
||||
|
2
js/jquery.tablesorter.min.js
vendored
2
js/jquery.tablesorter.min.js
vendored
File diff suppressed because one or more lines are too long
@ -16,30 +16,34 @@ $.tablesorter = $.tablesorter || {};
|
||||
|
||||
$.tablesorter.themes = {
|
||||
"bootstrap" : {
|
||||
table : 'table table-bordered table-striped',
|
||||
header : 'bootstrap-header', // give the header a gradient background
|
||||
icons : '', // add "icon-white" to make them white; this icon class is added to the <i> in the header
|
||||
sortNone : 'bootstrap-icon-unsorted',
|
||||
sortAsc : 'icon-chevron-up',
|
||||
sortDesc : 'icon-chevron-down',
|
||||
active : '', // applied when column is sorted
|
||||
hover : '', // use custom css here - bootstrap class may not override it
|
||||
filterRow: '', // filter row class
|
||||
even : '', // even row zebra striping
|
||||
odd : '' // odd row zebra striping
|
||||
table : 'table table-bordered table-striped',
|
||||
header : 'bootstrap-header', // give the header a gradient background
|
||||
footerRow : '',
|
||||
footerCells: '',
|
||||
icons : '', // add "icon-white" to make them white; this icon class is added to the <i> in the header
|
||||
sortNone : 'bootstrap-icon-unsorted',
|
||||
sortAsc : 'icon-chevron-up',
|
||||
sortDesc : 'icon-chevron-down',
|
||||
active : '', // applied when column is sorted
|
||||
hover : '', // use custom css here - bootstrap class may not override it
|
||||
filterRow : '', // filter row class
|
||||
even : '', // even row zebra striping
|
||||
odd : '' // odd row zebra striping
|
||||
},
|
||||
"jui" : {
|
||||
table : 'ui-widget ui-widget-content ui-corner-all', // table classes
|
||||
header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
|
||||
icons : 'ui-icon', // icon class added to the <i> in the header
|
||||
sortNone : 'ui-icon-carat-2-n-s',
|
||||
sortAsc : 'ui-icon-carat-1-n',
|
||||
sortDesc : 'ui-icon-carat-1-s',
|
||||
active : 'ui-state-active', // applied when column is sorted
|
||||
hover : 'ui-state-hover', // hover class
|
||||
filterRow: '',
|
||||
even : 'ui-widget-content', // even row zebra striping
|
||||
odd : 'ui-state-default' // odd row zebra striping
|
||||
table : 'ui-widget ui-widget-content ui-corner-all', // table classes
|
||||
header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
|
||||
footerRow : '',
|
||||
footerCells: '',
|
||||
icons : 'ui-icon', // icon class added to the <i> in the header
|
||||
sortNone : 'ui-icon-carat-2-n-s',
|
||||
sortAsc : 'ui-icon-carat-1-n',
|
||||
sortDesc : 'ui-icon-carat-1-s',
|
||||
active : 'ui-state-active', // applied when column is sorted
|
||||
hover : 'ui-state-hover', // hover class
|
||||
filterRow : '',
|
||||
even : 'ui-widget-content', // even row zebra striping
|
||||
odd : 'ui-state-default' // odd row zebra striping
|
||||
}
|
||||
};
|
||||
|
||||
@ -124,10 +128,16 @@ $.tablesorter.addWidget({
|
||||
if (o.even !== '') { wo.zebra[0] += ' ' + o.even; }
|
||||
if (o.odd !== '') { wo.zebra[1] += ' ' + o.odd; }
|
||||
// add table/footer class names
|
||||
$t
|
||||
t = $t
|
||||
// remove other selected themes; use widgetOptions.theme_remove
|
||||
.removeClass( c.theme === '' ? '' : 'tablesorter-' + c.theme )
|
||||
.addClass('tablesorter-' + theme + ' ' + o.table); // add theme widget class name
|
||||
.addClass('tablesorter-' + theme + ' ' + o.table) // add theme widget class name
|
||||
.find('tfoot');
|
||||
if (t.length) {
|
||||
t
|
||||
.find('tr').addClass(o.footerRow)
|
||||
.children('th, td').addClass(o.footerCells);
|
||||
}
|
||||
c.theme = ''; // clear out theme option so it doesn't interfere
|
||||
// update header classes
|
||||
$h
|
||||
|
20
js/jquery.tablesorter.widgets.min.js
vendored
20
js/jquery.tablesorter.widgets.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tablesorter",
|
||||
"version": "2.5.2",
|
||||
"version": "2.6",
|
||||
"title": "tablesorter",
|
||||
"author": {
|
||||
"name": "Christian Bach",
|
||||
|
Loading…
Reference in New Issue
Block a user