我有一张桌子,你可以看到:
<table id="DataTable" class="table table-condensed">
<thead>
<tr class="headings">
<th >ÙØ§Ù
Ù ÙØ§Ù
خاÙÙØ§Ø¯Ú¯Û </th>
<th></th>
<th>ÙÙØª Ù
ÙØ§Ùات </th>
<th>Ù
ÙØ§Ùات Ø´ÙÙØ¯Ù </th>
<th>زÙ
Ø§Ù ÙØ±Ùد </th>
<th>زÙ
Ø§Ù Ø®Ø±ÙØ¬ </th>
<th>عÙ
ÙÛØ§Øª</th>
</tr>
</thead>
<tbody>
@foreach (ReferralTrafficView item in Model)
{
}
</tbody>
</table>
这是我的数据表配置:
<script>
$(document).ready(function () {
$('#DataTable').DataTable({
"paging": true,
"pageLength": 10,
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "ÙÙ
Ù"]],
"ordering": true,
"processing": true,
"info": true,
"dom": "<'row'<'col-md-6 text-right'f><'col-md-6 text-left'>>"
+ "<'row'<'col-md-12'tr>>" +
"<'row'<'col-md-5 text-right rtl'p> <'col-md-7 text-left'i>>",
"language": {
"search": "_INPUT_",
"searchPlaceholder": "جستجÙ...", "sLoadingRecords": "در ØØ§Ù Ø¯Ø±ÛØ§Ùت Ø§Ø·ÙØ§Ø¹Ø§Øª...", "sProcessing": "در ØØ§Ù پردازش...",
"lengthMenu": "ÙÙ
Ø§ÛØ´ _MENU_ ردÛ٠در ÙØ± ØµÙØÙ",
"zeroRecords": "Ù
ÙØ±Ø¯Û ÛØ§Ùت ÙØ´Ø¯!",
"info": "ÙÙ
Ø§ÛØ´ ØµÙØÙ _PAGE_ از _PAGES_",
"infoEmpty": "Ø¯Ø§Ø¯Ù ÙØ§Ø¨Ù ÙÙ
Ø§ÛØ´ Ù
ÙØ¬Ùد ÙÛØ³Øª.",
"infoFiltered": "(_TOTAL_ Ù
ÙØ±Ø¯ از Ú©Ù _MAX_ ÛØ§Ùت شد)",
"oPaginate": {
"sNext": "<i class='fa fa-angle-left'></i>",
"sPrevious": "<i class='fa fa-angle-right'></i>"
}
}
});
});
</script>
我在模型中的数据每次都被更改,我想刷新我的数据表而不刷新。这是我的控制器:
public ActionResult MyReception(string Id)
{
List<ReferralTrafficView> rf = new List<ReferralTrafficView>();
get data from database
return rf
}
我可以在datatable配置中设置控制器以自动获取数据并刷新数据而不重新加载页面吗?