0
我有一張我使用jQuery Datatables插件的表。我不斷收到以下錯誤(以加載頁面時的警告框的形式)。獲取錯誤請求使用jQuery數據表的未知參數
數據表警告:表ID =例子 - 爲0行
我繼續閱讀文檔,但不能把握在我的錯誤是請求的未知參數「10」。這裏是我的表:
<table id="example" class="table table-hover card display dataTable table_judge_tournoi">
<thead>
<tr>
<th>Exporté</th>
<th>Select</th>
<th>Prénom</th>
<th>Nom</th>
<th>Licence</th>
<th>Inscription</th>
<th class="text-center">Profil</th>
<th>Convocation en cours</th>
<th>Messages<th>
<th>Dispos</th>
</tr>
</thead>
<tbody>
<% @subscriptions.each do |subscription|%>
<tr class="subscription_item" id="<%= subscription.id %>">
<%if subscription.exported == true%>
<td>true</td>
<%else%>
<td>false</td>
<% end -%>
<% if subscription.status == "confirmed" %>
<td class="checkbox"><input class="checkbox-player" type="checkbox"></td>
<% else %>
<td></td>
<%end%>
<td class="first-name"><%= subscription.user.first_name%></td>
<td><%= subscription.user.last_name%></td>
<td><%= subscription.user.licence_number%></td>
<%if subscription.status == "pending" %>
<td>
<%= form_for [@tournament, subscription] do |f| %>
<%= f.select :status, Subscription.status.options, :confirm => 'Your confirm message', remote: true, class: "form-control subscription-status" %>
<%end%>
</td>
<%elsif subscription.status == "confirmed"%>
<td>
<div class="btn btn-success">
<a href="#" data-target="#confirme" data-toggle="modal" class="subscription_status">
Confirmé
</a>
</div>
<div class="modal fade" id="confirme">
<div class="modal-dialog mymodal">
<div class="modal-content text-center">
<div class="modal-header">
<h4 class="modal-title">Remboursement</h4>
<p>Ce joueur ne participe plus au tournoi finalement ? Vous pouvez le supprimer et procéder au remboursement de ses frais d'inscription ! <br></p>
<p> Il vous suffit de cliquer sur <strong>Rembourser</strong> ci-dessous pour que son inscription au tournoi soit supprimé et lui reverser ses frais d'inscription</p>
</div>
<div class="modal-body">
<%= form_tag refund_path(subscription) do %>
<%= hidden_field_tag :subscription_id_refund, subscription.id %>
<%= submit_tag "Rembourser ce joueur", id: "export", class: "btn btn-warning"%>
<% end -%>
</div>
<div class="modal-footer">
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
</td>
<%elsif subscription.status == "sent"%>
<td>
<p>Envoyée</p>
<%else%>
<td>
<div class="btn btn-danger">
<a href="#" data-target="#refuse" data-toggle="modal" class="subscription_status">
Refusé
</a>
</div>
<div class="modal fade" id="refuse">
<div class="modal-dialog mymodal">
<div class="modal-content text-center">
<div class="modal-header">
<h4 class="modal-title">Accepter ?</h4>
<p>Vous souhaitez finalement accepter ce joueur au sein du tournoi ? Pas de problèmes. Cliquer sur "Nouvelle demande d'inscription" ci-dessous pour que celui-ci procède au paiement en ligne </p>
</div>
<div class="modal-body">
<%= form_tag askpayment_path(subscription) do %>
<%= hidden_field_tag :subscription_id_judge_asks, subscription.id %>
<%= submit_tag "Nouvelle demande d'inscription", id: "export", class: "btn btn-warning"%>
<% end -%>
</div>
<div class="modal-footer">
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
</td>
<% end %>
<td><button type="button" class="btn btn-primary "><%=link_to "Profil", user_path(subscription.user) %></button></td>
<% if subscription.convocations.last %>
<td><%= subscription.convocations.last.status_text %></td>
<%else%>
<td></td>
<% end %>
<% if subscription.convocations.last && subscription.convocations.last.messages != [] %>
<td>
<%=link_to "+1", convocation_messages_path(subscription.convocations.last), class: "btn btn-success" %>
</td>
<%else%>
<td></td>
<% end %>
<% if subscription.disponibility %>
<td>
<%= link_to image_tag("fleche_bleufonce.svg"), subscription_disponibility_path(subscription, subscription.disponibility), class: "fleche_subscription" %>
</td>
<% else %>
<td>Non renseignées</td>
<% end %>
</tr>
<%end%>
</tbody>
</table>
這裏的JS對數據表的工作:
$(document).ready(function() {
$.fn.dataTableExt.oStdClasses["sFilter"] = "my-style-class";
$('#example').DataTable({
"paging": false,
"ordering": false,
"info": false,
});
});
發現問題'
@DavidGeismar,太棒了!我錯過了雙'
相關問題