Debian Codegraph @

docs/example-widget-ui-theme.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>jQuery tablesorter 2.0 - jQuery UITheme Widget (jQuery UI)</title>
6
7 <!-- jQuery -->
8 <script src="js/jquery-latest.min.js"></script>
9
10 <!-- Demo stuff -->
11 <link rel="stylesheet" href="css/jq.css">
12 <link href="css/prettify.css" rel="stylesheet">
13 <script src="js/prettify.js"></script>
14 <script src="js/docs.js"></script>
15
16 <!-- jQuery UI theme switcher: https://github.com/pontikis/jui_theme_switch/ -->
17 <style>
18 .switcher_container { padding: 5px; }
19 .switcher_list { padding: 2px; }
20 .switcher_label { margin-right: 5px; }
21 </style>
22 <script src="js/jquery.jui_theme_switch.min.js"></script>
23
24 <!-- Tablesorter: required; also include any of the jQuery UI themes -->
25 <link id="ui-theme" rel="stylesheet" href="css/jquery-ui.min.css">
26 <link href="../css/theme.jui.css" rel="stylesheet">
27 <link href="../css/theme.grey.css" rel="stylesheet">
28
29 <script src="../js/jquery.tablesorter.js"></script>
30 <script src="../js/widgets/widget-filter.js"></script>
31 <script src="../js/widgets/widget-uitheme.js"></script>
32
33 <!-- Tablesorter: optional -->
34 <!-- <script src="../addons/pager/jquery.tablesorter.pager.js"></script> -->
35
36 <script id="js">$(function() {
37
38 // Extend the themes to change any of the default class names
39 $.extend($.tablesorter.themes.jui, {
40 // change default jQuery uitheme icons - find the full list of icons at
41 // http://jqueryui.com/themeroller/ (hover over them for their name)
42 table : 'ui-widget ui-widget-content ui-corner-all', // table classes
43 caption : 'ui-widget-content',
44 // header class names
45 header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
46 sortNone : '',
47 sortAsc : '',
48 sortDesc : '',
49 active : 'ui-state-active', // applied when column is sorted
50 hover : 'ui-state-hover', // hover class
51 // icon class names
52 icons : 'ui-icon', // icon class added to the <i> in the header
53 iconSortNone : 'ui-icon-carat-2-n-s ui-icon-caret-2-n-s', // class name added to icon when column is not sorted
54 iconSortAsc : 'ui-icon-carat-1-n ui-icon-caret-1-n', // class name added to icon when column has ascending sort
55 iconSortDesc : 'ui-icon-carat-1-s ui-icon-caret-1-s', // class name added to icon when column has descending sort
56 filterRow : '',
57 footerRow : '',
58 footerCells : '',
59 even : 'ui-widget-content', // even row zebra striping
60 odd : 'ui-state-default' // odd row zebra striping
61 });
62
63 // call the tablesorter plugin and apply the ui theme widget
64 $("table").tablesorter({
65
66 theme : 'jui', // theme "jui" and "bootstrap" override the uitheme widget option in v2.7+
67
68 headerTemplate : '{content} {icon}', // needed to add icon for jui theme
69
70 // widget code now contained in the jquery.tablesorter.widgets.js file
71 widgets : ['uitheme', 'filter', 'zebra'],
72
73 widgetOptions : {
74 // zebra striping class names - the uitheme widget adds the class names defined in
75 // $.tablesorter.themes to the zebra widget class names
76 zebra : ["even", "odd"],
77
78 // set the uitheme widget to use the jQuery UI theme class names
79 // ** this is now optional, and will be overridden if the theme name exists in $.tablesorter.themes **
80 // uitheme : 'jui'
81 }
82
83 });
84
85 });</script>
86
87 <script>
88 $(function() {
89 $('#switcher').jui_theme_switch({
90 stylesheet_link_id : 'ui-theme',
91 default_theme : 'cupertino',
92 datasource_url : 'assets/theme_switcher.json'
93 });
94 });
95 </script>
96
97 </head>
98 <body>
99
100 <div id="banner">
101 <h1>table<em>sorter</em></h1>
102 <h2>jQuery UITheme Widget (jQuery UI)</h2>
103 <h3>Flexible client-side table sorting</h3>
104 <a href="index.html">Back to documentation</a>
105 </div>
106
107 <div id="main">
108
109 <p class="tip">
110 <em>NOTE!</em>
111 </p>
112 <ul>
113 <li>In <span class="version">v2.27.0</span>, the icon class name changes used by jQuery 1.12.0 have been included. Icon class names were renamed from using "carat" to "caret"; this widget now includes both for backwards compatibility.</li>
114 <li>In <span class="version">v2.19.0</span>, this widget allows dynamic changing of themes; including switching from jQuery UI or Bootstrap to any other theme. To change a theme, do the following:
115 <pre class="prettyprint lang-js">var $table = $('table');
116 $table[0].config.theme = 'grey';
117 $table.trigger('applyWidgets');</pre>
118 To see this work, check out the <a href="example-widget-scroller.html">scroller widget demo</a>.
119 </li>
120 <li>As of tablesorter version 2.9+, this widget can no longer be applied to versions of tablesorter prior to version 2.8.</li>
121 <li>You will need to modify the <code>headerTemplate</code> option to include the bootstrap icon! See the example in the code (v2.7).</li>
122 <li>The original "widgetUitheme" option has been replaced by "widgetOptions.uitheme". See the javascript block below for more details (v2.1).</li>
123 <li>In tablesorter v2.4, the <code>uitheme</code> option has changed to indicate the theme instead of an array of icons to use:
124 <ul>
125 <li>All theme class names are now contained within <code>$.tablesorter.themes</code> with the jQuery UI theme saved to <code>$.tablesorter.themes.jui</code></li>
126 <li>The themes variable allows you to modify the class names for the table, header, sort icons, active state, hover state, filter inputs and zebra striping. See the code below on how to extend these variables.</li>
127 <li>Set the <code>uitheme</code> widget option to <code>"jui"</code> to set the widget to use the jQuery UI theme. See the <a href="example-option-theme-bootstrap-v3.html">bootstrap demo</a> for another example.</li>
128 </ul>
129 </li>
130 <li>Earlier widget versions required jQuery 1.4+. The UITheme widget for tablesorter 2.4+ requires jQuery 1.2.6+.</li>
131 </ul>
132
133 <h1>Demo</h1>
134 <br>
135 jQuery UI Theme:
136 <div id="switcher"></div>
137 <br>
138
139 <div id="demo"><table class="tablesorter">
140 <caption>Some interesting caption</caption>
141 <thead>
142 <tr>
143 <th>First Name</th>
144 <th>Last Name</th>
145 <th>Age</th>
146 <th>Total</th>
147 <th>Discount</th>
148 <th>Date</th>
149 </tr>
150 </thead>
151 <tfoot>
152 <tr>
153 <th>First Name</th>
154 <th>Last Name</th>
155 <th>Age</th>
156 <th>Total</th>
157 <th>Discount</th>
158 <th>Date</th>
159 </tr>
160 </tfoot>
161 <tbody>
162 <tr>
163 <td>Peter</td>
164 <td>Parker</td>
165 <td>28</td>
166 <td>$9.99</td>
167 <td>20%</td>
168 <td>Jul 6, 2006 8:14 AM</td>
169 </tr>
170 <tr>
171 <td>John</td>
172 <td>Hood</td>
173 <td>33</td>
174 <td>$19.99</td>
175 <td>25%</td>
176 <td>Dec 10, 2002 5:14 AM</td>
177 </tr>
178 <tr>
179 <td>Clark</td>
180 <td>Kent</td>
181 <td>18</td>
182 <td>$15.89</td>
183 <td>44%</td>
184 <td>Jan 12, 2003 11:14 AM</td>
185 </tr>
186 <tr>
187 <td>Bruce</td>
188 <td>Almighty</td>
189 <td>45</td>
190 <td>$153.19</td>
191 <td>44%</td>
192 <td>Jan 18, 2001 9:12 AM</td>
193 </tr>
194 <tr>
195 <td>Bruce</td>
196 <td>Evans</td>
197 <td>22</td>
198 <td>$13.19</td>
199 <td>11%</td>
200 <td>Jan 18, 2007 9:12 AM</td>
201 </tr>
202 </tbody>
203 </table></div>
204
205 <h1>Page Header</h1>
206 <div>
207 <pre class="prettyprint lang-html">&lt;!-- ui theme stylesheet - contents shown below --&gt;
208 &lt;link rel=&quot;stylesheet&quot; href=&quot;../css/theme.jui.css&quot;&gt;
209 &lt;!-- jQuery UI theme (cupertino example here) --&gt;
210 &lt;link rel=&quot;stylesheet&quot; href=&quot;css/jquery-ui.min.css&quot;&gt;
211
212 &lt;!-- load jQuery first --&gt;
213 &lt;script src=&quot;js/jquery.min.js&quot;&gt;&lt;/script&gt;
214
215 &lt;!-- tablesorter plugin --&gt;
216 &lt;script src=&quot;../js/jquery.tablesorter.js&quot;&gt;&lt;/script&gt;
217 &lt;!-- tablesorter widget file - loaded after the plugin --&gt;
218 &lt;script src=&quot;../js/jquery.tablesorter.widgets.js&quot;&gt;&lt;/script&gt;</pre>
219 </div>
220
221 <h1>Javascript</h1>
222 <div id="javascript">
223 <pre class="prettyprint lang-javascript"></pre>
224 </div>
225
226 <h1>HTML</h1>
227 <div id="html">
228 <pre class="prettyprint lang-html"></pre>
229 </div>
230
231 <div class="next-up">
232 <hr />
233 Next up: <a href="example-option-theme-bootstrap-v3.html">UITheme widget - Bootstrap theme &rsaquo;&rsaquo;</a><br>
234 Second time around: <a href="example-option-render-header.html">Modifying the Header during rendering &rsaquo;&rsaquo;</a>
235 </div>
236
237 </div>
238
239 </body>
240 </html>