我是新来的jQuery和ASP.Net MVC。我正在开发一个使用jQuery的mvc应用程序。jQuery数据表reDraw问题
我在jQuery数据表中存在问题。在更新或删除方法之后,我们需要重新构建Datatable。我使用jquery做了它,但是我无法像之前那样加载数据表。请帮助我解决这个问题。
<table id="ViewxxTable" width="100%"> //Here is the table I want to reconstruct
<thead>
<tr>
<th>SN No</th>
<th>Item code</th>
</tr>
</thead>
<tbody>
<%
List<InSys.Models.xxDetailClass> xxdetailLst = (List<InSys.Models.xxDetailClass>)Session["xxddetailLst"];
foreach (InSys.Models.xxDetailClass grnd in xxdetailLst)
{
%>
<tr>
<td><%= grnd.SnNo%></td>
<td><%= grnd.ItemCode%></td>
<td>
</tr>
<%
}
%>
</tbody>
</table>
jQuery的
oTable = $('#ViewxxTable').dataTable({
"bPaginate": false,
"bJQueryUI": true,
"bRetrieve": true,
"bDestroy": true,
"sPaginationType": "full_numbers"
});
感谢您的回答维韦克....但它did'nt工作,当我重新构建数据表后插入或更新只显示标题和foter在数据表数据显示在一个普通的html表中,并在该表头和foter ... – Samanalaya
$(document).ready(function(){ – Samanalaya