这是我第一次尝试jQuery数据表。JQuery数据表不会将数据加载到表中。有任何想法吗?
我想用php中的数据使用jquery数据表填充html表。
下面的代码卡在Loading data from server
。
任何想法我需要做什么改变,使这项工作?
<link rel="stylesheet" type="text/css" href="css/header.css">
<div id="container">
<div style="width:680px">
<table id="tbDetails" cellpadding="0" cellspacing="0" id="example">
<thead style="background-color:#DC5807; color:White; font-weight:bold;font-size:10pt;">
<tr style="border:solid 1px #000000">
<th width="5%">ID</th>
<th width="10%">Date</th>
<th width="10%">Request Status</th>
<th width="15%">Requestor FullName</th>
<th width="15%">Requestor WorkPhone</th>
<th width="15%">Requestor Email</th>
<th width="15%">Primary SiteContact</th>
<th width="15%">Secondary SiteContact</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="8" class="dataTables_empty">Loading data from server</td>
</tr>
</tbody>
</table>
</div>
<div class="spacer"></div>
</div>
<style type="text/css">
@import "jquery/dataTables/media/css/jquery-ui.css";
@import "jquery/datatables/media/css/demo_table.css";
td{padding-right:30px;}
.row_selected{color: gray;}
</style>
<script type="text/javascript">
$(document).ready(function() {
var what = "customer";
/* Init DataTables */
var oTable = $('#example).dataTable({
"bJQueryUI" : true,
//"bProcessing" : true,
"bServerSide" : true,
"sPaginationType" : "RequestID",
"sAjaxSource" : "filltable.php",
"aoColumns" : [{
"sClass" : "center",
"bSortable" : false,
}, {
"sName" : "RequestID",
"mData" : "2"
}, {
"sName" : "RequestDate",
"mData" : "3"
}, {
"sName" : "RequestStatus",
"mData" : "4"
}, {
"sName" : "RequestorFullName",
"mData" : "5"
}, {
"sName" : "RequestorWorkPhone",
"mData" : "6"
}, {
"sName" : "RequestorEmail",
"mData" : "7"
}, {
"sName" : "PrimarySiteContactDisplay",
"mData" : "8"
}, {
"sName" : "SecondarySiteContactDisplay",
"mData" : "9"
}],
"aaSorting" : [[1, 'RequestDescription']]
})
});
</script>
提前
某些原因,很多的感谢,也许我的浏览器是旧的,它不再让我点击Add commnt
。
Iny任何情况,谢谢指出。我不知道为什么它在我的帖子后消失了。
我的代码有刻度线。
不用说,这不是问题。
Eduardo,请原谅我。出于某种原因,就在今天,这不允许我添加评论。
所以,我在这里做。也许是老浏览器。
我认为我这样做的方式应该可以工作。
所以,我真的不知道问题是什么。
我会尝试改变你的建议,但不知道这是这里的解决方案。