我正在为我的数据使用 Datatables,但现在我希望用户可以修改存储在 db 上的数据。所以我读到我可以使用 jeditable,但是当你按下回车键时,我不知道如何将数据发送到服务器。我读了这个问题:链接,但我不知道如何实现它。谁能帮我?我需要使用第二个表示例来执行此操作:
<form action="/repairServlet" method="post">
<input type="hidden" name="action" value="aggiorna">
<input type="hidden" name="keycar" value="<%=KeyFactory.keyToString(keycar)%>">
<input type="hidden" name="plate" value="<%=repair.getProperty("plate")%>">
<input type="hidden" name="km" value="<%=repair.getProperty("km")%>">
<input type="hidden" name="keyRepair" value="<%=KeyFactory.keyToString(repairKey)%>">
<table width="200" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>Data Riparazione</td>
<td><input type="date" name="date" value="<%=(String)repair.getProperty("date") %>" /></td>
<td>Stato</td>
<td><select name="selectStato" size="3" multiple="multiple"
tabindex="1">
<option value="1">In corso</option>
<option value="2">Sospesa</option>
<option value="3">Conclusa</option>
</select>
<td>KM</td>
<td><input type="text" name="km" value="<%=(String)repair.getProperty("km") %>" /></td>
<td>Targa</td>
<td><h4>
<label>   <%=(String)repair.getProperty("plate") %></label>
</h4></td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" border="0" class="display"
id="example">
<thead>
<tr>
<th>Indice</th>
<th>Tipo</th>
<th>Descrizione</th>
<th>Quantità</th>
<th>Prezzo</th>
<th>Totale</th>
<th>Azioni</th>
</tr>
</thead>
<tbody>
<%for(Entity lr : listaRepairs){ %>
<tr>
<td>ddd</td>
<td><% out.print(lr.getProperty("type"));%></td>
<td><% out.print(lr.getProperty("description"));%></td>
<td><% out.print(lr.getProperty("qta"));%></td>
<td><% out.print(lr.getProperty("price"));%></td>
<td><% out.print(lr.getProperty("tot"));%></td>
<td><input type="submit" name="Aggiorna" /></td>
</tr>
<%-- <tr>
<td>ddd</td>
<td><input type="text" name="type" value="<%=lr.getProperty("type") %>" />
<input type="hidden" name="keyLineRepair" value="<%=KeyFactory.keyToString(lr.getKey())%>">
</td>
<td><input type="text" name="description" value="<%=lr.getProperty("description") %>"/></td>
<td><input type="text" name="qta" value="<%=lr.getProperty("qta") %>"/></td>
<td><input type="text" name="price" value="<%=lr.getProperty("price") %>" /></td>
<td><%=lr.getProperty("tot") %></td>
<td><input type="submit" name="Aggiorna" /></td>
</tr> --%>
<%} %>
</tbody>
</table>