2016-06-23 9 views
0

Ich habe versucht, diese Arbeit zu machen, und ich kann nicht eine Lösung zu finden scheinen:Responsive Beurteilungen nicht auf jquery-Datentabellen-Schienen

ich einen Tisch haben und ich habe eine grundlegende Initialisierung des Datentabellen Alles scheint gut zu funktionieren, aber sobald das Responsive aktiviert ist, funktioniert die Detail-Schaltfläche nicht mehr, wenn ich darauf klicke, wird es rot mit dem - Zeichen, aber die Details erscheinen nicht.

Dies ist meine Tabelle:

<table id="tabla" class="display dt-responsive no-wrap" width="100%"> 
    <thead> 
    <tr> 
     <th>Profesor</th> 
     <th>Materia</th> 
     <th>Seccion</th> 
     <th></th> 
     <th></th> 
     <th></th> 
     <th></th> 
    </tr> 
    </thead> 
    <tbody> 
    <% @profesors.each do |profesor| %> 
     <tr> 
     <td><%= profesor.profesor %></td> 
     <td><%= profesor.materia %></td> 
     <td><%= profesor.seccion %></td> 
     <td><%= link_to 'Show', profesor %></td> 
     <td><%= link_to 'Edit', edit_profesor_path(profesor) %></td> 
     <td><%= link_to 'Destroy', profesor, method: :delete, data: { confirm: 'Are you sure?' } %></td> 
     <td><%= link_to 'Alumnos', alumnos_path("prof" => profesor) %></td> 
     </tr> 
    <% end %> 
    </tbody> 
</table> 

Das ist mein JS ist

$('#tabla').DataTable({ 
    responsive: true 
}); 

Antwort

0

Wenn Sie Bootstrap versuchen verwenden <div class="table-responsive"> die <table> mit Einwickeln link

Manche mögen:

<div class="table-responsive"> 
    <table id="tabla" class="display dt-responsive no-wrap" width="100%"> 
    <thead> 
     <tr> 
     <th>Profesor</th> 
     <th>Materia</th> 
     <th>Seccion</th> 
     <th></th> 
     <th></th> 
     <th></th> 
     <th></th> 
     </tr> 
    </thead> 
    <tbody> 
     <% @profesors.each do |profesor| %> 
     <tr> 
      <td><%= profesor.profesor %></td> 
      <td><%= profesor.materia %></td> 
      <td><%= profesor.seccion %></td> 
      <td><%= link_to 'Show', profesor %></td> 
      <td><%= link_to 'Edit', edit_profesor_path(profesor) %></td> 
      <td><%= link_to 'Destroy', profesor, method: :delete, data: { confirm: 'Are you sure?' } %></td> 
      <td><%= link_to 'Alumnos', alumnos_path("prof" => profesor) %></td> 
     </tr> 
     <% end %> 
    </tbody> 
    </table> 
</div> 
Verwandte Themen