1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

Update: Update sorting plug-in examples to use enumerated data

- Th old comma as a decimal place plug-in isn't needed anymore since
  DataTables now has that ability built in using the `thousands` and
  `decimal` options
This commit is contained in:
Allan Jardine 2014-03-24 15:15:44 +00:00
parent e89310fbcf
commit 6924ccb237
3 changed files with 155 additions and 133 deletions

View File

@ -1 +1 @@
cba42b31d2507f8fd61ad5b8a4bffae6817b3a16
d50b5585426b88bb0d3942949cd5d7238dc441ec

View File

@ -21,12 +21,19 @@
$.fn.dataTable.ext.type.detect.unshift(
function ( d ) {
return /^[\-\d,]+$/.test( d ) ? 'numeric-comma' : null;
return d === 'Low' || d === 'Medium' || d === 'High' ?
'salary-grade' :
null;
}
);
$.fn.dataTable.ext.type.order['numeric-comma-pre'] = function ( d ) {
return parseFloat( d.replace(/,/g, '.') ) || 0;
$.fn.dataTable.ext.type.order['salary-grade-pre'] = function ( d ) {
switch ( d ) {
case 'Low': return 1;
case 'Medium': return 2;
case 'High': return 3;
}
return 0;
};
@ -54,8 +61,7 @@ $(document).ready(function() {
about type detection and ordering plug-ins; creating them and their requirements, please refer to the
plug-in development documentation.</p>
<p>This example shows ordering with a comma for a decimal place, as is often used in parts of Europe
with automatic type detection.</p>
<p>This example shows ordering with using an enumerated type.</p>
<p>A wide variety of ready made ordering plug-ins can be found on <a href=
"//datatables.net/plug-ins/sorting">the DataTables plug-ins page</a>.</p>
@ -91,7 +97,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320.800,00</td>
<td>Low</td>
</tr>
<tr>
<td>Garrett Winters</td>
@ -99,7 +105,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170.750,00</td>
<td>Low</td>
</tr>
<tr>
<td>Ashton Cox</td>
@ -107,7 +113,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Cedric Kelly</td>
@ -115,7 +121,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433.060,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Airi Satou</td>
@ -123,7 +129,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162.700,00</td>
<td>Low</td>
</tr>
<tr>
<td>Brielle Williamson</td>
@ -131,7 +137,7 @@ $(document).ready(function() {
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372.000,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Herrod Chandler</td>
@ -139,7 +145,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Rhona Davidson</td>
@ -147,7 +153,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327.900,00</td>
<td>Low</td>
</tr>
<tr>
<td>Colleen Hurst</td>
@ -155,7 +161,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Sonya Frost</td>
@ -163,7 +169,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103.600,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jena Gaines</td>
@ -171,7 +177,7 @@ $(document).ready(function() {
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90.560,00</td>
<td>Low</td>
</tr>
<tr>
<td>Quinn Flynn</td>
@ -179,7 +185,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Charde Marshall</td>
@ -187,7 +193,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470.600,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Haley Kennedy</td>
@ -195,7 +201,7 @@ $(document).ready(function() {
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
@ -203,7 +209,7 @@ $(document).ready(function() {
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385.750,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Michael Silva</td>
@ -211,7 +217,7 @@ $(document).ready(function() {
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Paul Byrd</td>
@ -219,7 +225,7 @@ $(document).ready(function() {
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Gloria Little</td>
@ -227,7 +233,7 @@ $(document).ready(function() {
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Bradley Greer</td>
@ -235,7 +241,7 @@ $(document).ready(function() {
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Dai Rios</td>
@ -243,7 +249,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
@ -251,7 +257,7 @@ $(document).ready(function() {
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Yuri Berry</td>
@ -259,7 +265,7 @@ $(document).ready(function() {
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Caesar Vance</td>
@ -267,7 +273,7 @@ $(document).ready(function() {
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106.450,00</td>
<td>Low</td>
</tr>
<tr>
<td>Doris Wilder</td>
@ -275,7 +281,7 @@ $(document).ready(function() {
<td>Sidney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85.600,00</td>
<td>Low</td>
</tr>
<tr>
<td>Angelica Ramos</td>
@ -283,7 +289,7 @@ $(document).ready(function() {
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1.200.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Gavin Joyce</td>
@ -291,7 +297,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92.575,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jennifer Chang</td>
@ -299,7 +305,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357.650,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Brenden Wagner</td>
@ -307,7 +313,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206.850,00</td>
<td>Low</td>
</tr>
<tr>
<td>Fiona Green</td>
@ -315,7 +321,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Shou Itou</td>
@ -323,7 +329,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Michelle House</td>
@ -331,7 +337,7 @@ $(document).ready(function() {
<td>Sidney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95.400,00</td>
<td>Low</td>
</tr>
<tr>
<td>Suki Burks</td>
@ -339,7 +345,7 @@ $(document).ready(function() {
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
@ -347,7 +353,7 @@ $(document).ready(function() {
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Gavin Cortez</td>
@ -355,7 +361,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Martena Mccray</td>
@ -363,7 +369,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324.050,00</td>
<td>Low</td>
</tr>
<tr>
<td>Unity Butler</td>
@ -371,7 +377,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85.675,00</td>
<td>Low</td>
</tr>
<tr>
<td>Howard Hatfield</td>
@ -379,7 +385,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Hope Fuentes</td>
@ -387,7 +393,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109.850,00</td>
<td>Low</td>
</tr>
<tr>
<td>Vivian Harrell</td>
@ -395,7 +401,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452.500,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Timothy Mooney</td>
@ -403,7 +409,7 @@ $(document).ready(function() {
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136.200,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jackson Bradshaw</td>
@ -411,7 +417,7 @@ $(document).ready(function() {
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645.750,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Olivia Liang</td>
@ -419,7 +425,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Bruno Nash</td>
@ -427,7 +433,7 @@ $(document).ready(function() {
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Sakura Yamamoto</td>
@ -435,7 +441,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139.575,00</td>
<td>Low</td>
</tr>
<tr>
<td>Thor Walton</td>
@ -443,7 +449,7 @@ $(document).ready(function() {
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98.540,00</td>
<td>Low</td>
</tr>
<tr>
<td>Finn Camacho</td>
@ -451,7 +457,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Serge Baldwin</td>
@ -459,7 +465,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138.575,00</td>
<td>Low</td>
</tr>
<tr>
<td>Zenaida Frank</td>
@ -467,7 +473,7 @@ $(document).ready(function() {
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125.250,00</td>
<td>Low</td>
</tr>
<tr>
<td>Zorita Serrano</td>
@ -475,7 +481,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
@ -483,7 +489,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75.650,00</td>
<td>Low</td>
</tr>
<tr>
<td>Cara Stevens</td>
@ -491,7 +497,7 @@ $(document).ready(function() {
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145.600,00</td>
<td>Low</td>
</tr>
<tr>
<td>Hermione Butler</td>
@ -499,7 +505,7 @@ $(document).ready(function() {
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356.250,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Lael Greer</td>
@ -507,7 +513,7 @@ $(document).ready(function() {
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jonas Alexander</td>
@ -515,7 +521,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Shad Decker</td>
@ -523,7 +529,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Michael Bruce</td>
@ -531,7 +537,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Donna Snider</td>
@ -539,7 +545,7 @@ $(document).ready(function() {
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112.000,00</td>
<td>Low</td>
</tr>
</tbody>
</table>
@ -557,12 +563,19 @@ $(document).ready(function() {
<p>The Javascript shown below is used to initialise the table shown in this
example:</p><code class="multiline brush: js;">$.fn.dataTable.ext.type.detect.unshift(
function ( d ) {
return /^[\-\d,]+$/.test( d ) ? 'numeric-comma' : null;
return d === 'Low' || d === 'Medium' || d === 'High' ?
'salary-grade' :
null;
}
);
$.fn.dataTable.ext.type.order['numeric-comma-pre'] = function ( d ) {
return parseFloat( d.replace(/,/g, '.') ) || 0;
$.fn.dataTable.ext.type.order['salary-grade-pre'] = function ( d ) {
switch ( d ) {
case 'Low': return 1;
case 'Medium': return 2;
case 'High': return 3;
}
return 0;
};

View File

@ -19,15 +19,20 @@
<script type="text/javascript" language="javascript" class="init">
$.fn.dataTable.ext.type.order['numeric-comma-pre'] = function ( d ) {
return parseFloat( d.replace(/,/g, '.') ) || 0;
$.fn.dataTable.ext.type.order['salary-grade-pre'] = function ( d ) {
switch ( d ) {
case 'Low': return 1;
case 'Medium': return 2;
case 'High': return 3;
}
return 0;
};
$(document).ready(function() {
$('#example').dataTable( {
"columnDefs": [ {
"type": "numeric-comma",
"targets": 3
"type": "salary-grade",
"targets": -1
} ]
} );
} );
@ -53,8 +58,7 @@ $(document).ready(function() {
the <code>$.fn.dataTable.ext.type.order</code> object. For more information about ordering plug-ins;
creating them and their requirements, please refer to the plug-in development documentation.</p>
<p>This example shows ordering with a comma for a decimal place, as is often used in parts of
Europe.</p>
<p>This example shows ordering with using an enumerated type.</p>
<p>A wide variety of ready made ordering plug-ins can be found on <a href=
"//datatables.net/plug-ins/sorting">the DataTables plug-ins page</a>.</p>
@ -90,7 +94,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320.800,00</td>
<td>Low</td>
</tr>
<tr>
<td>Garrett Winters</td>
@ -98,7 +102,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170.750,00</td>
<td>Low</td>
</tr>
<tr>
<td>Ashton Cox</td>
@ -106,7 +110,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Cedric Kelly</td>
@ -114,7 +118,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433.060,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Airi Satou</td>
@ -122,7 +126,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162.700,00</td>
<td>Low</td>
</tr>
<tr>
<td>Brielle Williamson</td>
@ -130,7 +134,7 @@ $(document).ready(function() {
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372.000,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Herrod Chandler</td>
@ -138,7 +142,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Rhona Davidson</td>
@ -146,7 +150,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327.900,00</td>
<td>Low</td>
</tr>
<tr>
<td>Colleen Hurst</td>
@ -154,7 +158,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Sonya Frost</td>
@ -162,7 +166,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103.600,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jena Gaines</td>
@ -170,7 +174,7 @@ $(document).ready(function() {
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90.560,00</td>
<td>Low</td>
</tr>
<tr>
<td>Quinn Flynn</td>
@ -178,7 +182,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Charde Marshall</td>
@ -186,7 +190,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470.600,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Haley Kennedy</td>
@ -194,7 +198,7 @@ $(document).ready(function() {
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Tatyana Fitzpatrick</td>
@ -202,7 +206,7 @@ $(document).ready(function() {
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385.750,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Michael Silva</td>
@ -210,7 +214,7 @@ $(document).ready(function() {
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Paul Byrd</td>
@ -218,7 +222,7 @@ $(document).ready(function() {
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Gloria Little</td>
@ -226,7 +230,7 @@ $(document).ready(function() {
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Bradley Greer</td>
@ -234,7 +238,7 @@ $(document).ready(function() {
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Dai Rios</td>
@ -242,7 +246,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jenette Caldwell</td>
@ -250,7 +254,7 @@ $(document).ready(function() {
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Yuri Berry</td>
@ -258,7 +262,7 @@ $(document).ready(function() {
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Caesar Vance</td>
@ -266,7 +270,7 @@ $(document).ready(function() {
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106.450,00</td>
<td>Low</td>
</tr>
<tr>
<td>Doris Wilder</td>
@ -274,7 +278,7 @@ $(document).ready(function() {
<td>Sidney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85.600,00</td>
<td>Low</td>
</tr>
<tr>
<td>Angelica Ramos</td>
@ -282,7 +286,7 @@ $(document).ready(function() {
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1.200.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Gavin Joyce</td>
@ -290,7 +294,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92.575,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jennifer Chang</td>
@ -298,7 +302,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357.650,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Brenden Wagner</td>
@ -306,7 +310,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206.850,00</td>
<td>Low</td>
</tr>
<tr>
<td>Fiona Green</td>
@ -314,7 +318,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850.000,00</td>
<td>High</td>
</tr>
<tr>
<td>Shou Itou</td>
@ -322,7 +326,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Michelle House</td>
@ -330,7 +334,7 @@ $(document).ready(function() {
<td>Sidney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95.400,00</td>
<td>Low</td>
</tr>
<tr>
<td>Suki Burks</td>
@ -338,7 +342,7 @@ $(document).ready(function() {
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Prescott Bartlett</td>
@ -346,7 +350,7 @@ $(document).ready(function() {
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Gavin Cortez</td>
@ -354,7 +358,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Martena Mccray</td>
@ -362,7 +366,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324.050,00</td>
<td>Low</td>
</tr>
<tr>
<td>Unity Butler</td>
@ -370,7 +374,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85.675,00</td>
<td>Low</td>
</tr>
<tr>
<td>Howard Hatfield</td>
@ -378,7 +382,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Hope Fuentes</td>
@ -386,7 +390,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109.850,00</td>
<td>Low</td>
</tr>
<tr>
<td>Vivian Harrell</td>
@ -394,7 +398,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452.500,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Timothy Mooney</td>
@ -402,7 +406,7 @@ $(document).ready(function() {
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136.200,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jackson Bradshaw</td>
@ -410,7 +414,7 @@ $(document).ready(function() {
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645.750,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Olivia Liang</td>
@ -418,7 +422,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Bruno Nash</td>
@ -426,7 +430,7 @@ $(document).ready(function() {
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Sakura Yamamoto</td>
@ -434,7 +438,7 @@ $(document).ready(function() {
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139.575,00</td>
<td>Low</td>
</tr>
<tr>
<td>Thor Walton</td>
@ -442,7 +446,7 @@ $(document).ready(function() {
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98.540,00</td>
<td>Low</td>
</tr>
<tr>
<td>Finn Camacho</td>
@ -450,7 +454,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Serge Baldwin</td>
@ -458,7 +462,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138.575,00</td>
<td>Low</td>
</tr>
<tr>
<td>Zenaida Frank</td>
@ -466,7 +470,7 @@ $(document).ready(function() {
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125.250,00</td>
<td>Low</td>
</tr>
<tr>
<td>Zorita Serrano</td>
@ -474,7 +478,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jennifer Acosta</td>
@ -482,7 +486,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75.650,00</td>
<td>Low</td>
</tr>
<tr>
<td>Cara Stevens</td>
@ -490,7 +494,7 @@ $(document).ready(function() {
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145.600,00</td>
<td>Low</td>
</tr>
<tr>
<td>Hermione Butler</td>
@ -498,7 +502,7 @@ $(document).ready(function() {
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356.250,00</td>
<td>Medium</td>
</tr>
<tr>
<td>Lael Greer</td>
@ -506,7 +510,7 @@ $(document).ready(function() {
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Jonas Alexander</td>
@ -514,7 +518,7 @@ $(document).ready(function() {
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86.500,00</td>
<td>Low</td>
</tr>
<tr>
<td>Shad Decker</td>
@ -522,7 +526,7 @@ $(document).ready(function() {
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Michael Bruce</td>
@ -530,7 +534,7 @@ $(document).ready(function() {
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183.000,00</td>
<td>Low</td>
</tr>
<tr>
<td>Donna Snider</td>
@ -538,7 +542,7 @@ $(document).ready(function() {
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112.000,00</td>
<td>Low</td>
</tr>
</tbody>
</table>
@ -554,15 +558,20 @@ $(document).ready(function() {
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this
example:</p><code class="multiline brush: js;">$.fn.dataTable.ext.type.order['numeric-comma-pre'] = function ( d ) {
return parseFloat( d.replace(/,/g, '.') ) || 0;
example:</p><code class="multiline brush: js;">$.fn.dataTable.ext.type.order['salary-grade-pre'] = function ( d ) {
switch ( d ) {
case 'Low': return 1;
case 'Medium': return 2;
case 'High': return 3;
}
return 0;
};
$(document).ready(function() {
$('#example').dataTable( {
&quot;columnDefs&quot;: [ {
&quot;type&quot;: &quot;numeric-comma&quot;,
&quot;targets&quot;: 3
&quot;type&quot;: &quot;salary-grade&quot;,
&quot;targets&quot;: -1
} ]
} );
} );</code>