2016-10-25 3 views
0

Ich habe diese Datentabelle DefinitionTables - nicht case-sensitive Bestellung

$(document).ready(function(){ 
       $('[data-toggle="tooltip"]').tooltip(); 
       var table = $('#producersTableId').DataTable({ 
        "dom": '<"top">rt<"bottom"lp><"clear">', 
        "autoWidth": false, 
        "order": [[1, 'asc']], 
        "columnDefs": [ 
         {"targets": [0], "width": '25%'}, 
         {"targets": [1], "width": '40%'}, 
         {className: "dt-body-center" , "targets": [2], "width": '5%'}, 
         {className: "dt-body-center" , "targets": [3], "width": '30%'},       
        ]      
       }); 
       table.columns().every(function() { 
        var that = this; 
        $('input', this.header()).on('keyup change', function() { 
         if (that.search() !== this.value) { 
          that 
           .search(this.value) 
           .draw(); 
         } 
        }); 
       }); 
      }); 

Gibt es eine Möglichkeit in der "order": [[1, 'asc']], Option Fall in der Reihenfolge (nicht case-sensitive Ordnung) zu ignorieren?

+0

DataTables verwendet bereits Groß- und Kleinschreibung, siehe https://jsfiddle.net/seo3d9jc/ –

Antwort

0

Bitte siehe https://datatables.net/forums/discussion/38495 und http://live.datatables.net/qobihina/1/edit. Der Code stammt aus einem Beispiel unter

Please see https://datatables.net/forums/discussion/38495 and http://live.datatables.net/qobihina/1/edit. The code is from an example on 

/* JAVASCRIPT */ 
$(document).ready(function() { var table = $('#example').DataTable(); }); 

/* HTML */ 
<table id="example" class="display nowrap" width="100%"> 
    <thead> 
     <tr> 
      <th>Name</th> 
      <th>Position</th> 
      <th>Office</th> 
      <th>Age</th> 
      <th>Start date</th> 
      <th>Salary</th> 
     </tr> 
    </thead> 
    <tfoot> 
     <tr> 
      <th>Name</th> 
      <th>Position</th> 
      <th>Office</th> 
      <th>Age</th> 
      <th>Start date</th> 
      <th>Salary</th> 
     </tr> 
    </tfoot> 
    <tbody> 
     <tr> 
      <td>b</td> 
      <td>System Architect</td> 
      <td>Edinburgh</td> 
      <td>61</td> 
      <td>2011/04/25</td> 
      <td>$3,120</td> 
     </tr> 
     <tr> 
      <td>B</td> 
      <td>Director</td> 
      <td>Edinburgh</td> 
      <td>63</td> 
      <td>2011/07/25</td> 
      <td>$5,300</td> 
     </tr> 
     <tr> 
      <td>A</td> 
      <td>Technical Author</td> 
      <td>San Francisco</td> 
      <td>66</td> 
      <td>2009/01/12</td> 
      <td>$4,800</td> 
     </tr> 
     <tr> 
      <td>a</td> 
      <td>Javascript Developer</td> 
      <td>Edinburgh</td> 
      <td>22</td> 
      <td>2012/03/29</td> 
      <td>$3,600</td> 
     </tr> 
    </tbody> 
</table>