首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jquery-datatables-rails上未显示响应详细信息

jquery-datatables-rails上未显示响应详细信息
EN

Stack Overflow用户
提问于 2016-06-23 23:39:45
回答 1查看 182关注 0票数 0

我一直在努力解决这个问题,但我似乎找不到解决方案:

我有一个表,我有一个数据表的基本初始化,一切似乎都很好,但是一旦响应被激活,详细信息按钮就不起作用了,如果我点击它,它会变成红色的-号,但是细节不会出现。

这是我的表格:

代码语言:javascript
复制
<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>

这是我的JS

代码语言:javascript
复制
$('#tabla').DataTable({
    responsive: true
});
EN

回答 1

Stack Overflow用户

发布于 2017-03-08 21:03:59

如果您使用引导,请尝试使用<div class="table-responsive"> link包装<table>

其中一些类似于:

代码语言:javascript
复制
<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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37996136

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档