這是我第一次嘗試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,請原諒我。出於某種原因,就在今天,這不允許我添加評論。
所以,我在這裏做。也許是老瀏覽器。
我認爲我這樣做的方式應該可以工作。
所以,我真的不知道問題是什麼。
我會嘗試改變你的建議,但不知道這是這裏的解決方案。