我试图用服务器端进程刷新数据表是错误的。但是它说CCD_ 1不是一个函数。我使用PHP在表中回显了我的数据。我使用的是数据表1.8.1。任何答复都将不胜感激。感谢
oTable = jQuery("#requestt").dataTable( {
"aaSorting": [],
"aoColumns": [
{ "bSearchable": true ,"bSortable": true},
{ "bSearchable": true ,"bSortable": true},
{ "bSearchable": true ,"bSortable": true},
{ "bSearchable": true ,"bSortable": true},
{ "bSearchable": true ,"bSortable": true},
{ "bSearchable": true ,"bSortable": true},
{ "bSearchable": false , "bSortable": false,"sWidth":"10%"},
{ "bSearchable": false , "bSortable": false,"sWidth":"10%"}
]
} );
function deleteBuildRequest(reqId){
$.post("/admin/deletebuildRequest",
{
rid:reqId
},
function(data){
oTable.draw();
}
);
}
<table id="requestt" class="display">
<thead>
<tr>
<th>Req Id</th>
<th>Domain</th>
<th>Framework</th>
<th>Server</th>
<th>Requested By</th>
<th>Date</th>
<th> </th>
<th>
<label><input class="del-checkbox" type="checkbox" id="checkAll"> Select All</label>
<div>
<a href="" class="btn btn-default delete-btn"><i class="fa fa-trash"></i>Delete</a>
</div>
</th>
</tr>
</thead>
<tbody>
<?php if ($requests->num_rows() > 0):?>
<?php foreach ($requests->result() as $row):?>
<tr>
<td><?php echo $row->ReqId?></td>
<td><?php echo $row->DomainName?></td>
<td><?php echo $row->FrameworkName?></td>
<td><?php echo $row->name?></td>
<td><?php echo $row->FirstName." ".$row->LastName?></td>
<td><?php echo date("m/d/y g:i A", strtotime( $row->DateRequested));?></td>
<td>
<?php if ($this->members->IsAdmin($this->session->userdata('userid'))===true):?>
<a href="javascript:void(0)" class="requestDelete" id="delete_<?php echo $row->ReqId ?>" title="delete"><i class="icon-remove"></i></a>
<a href="javascript:void(0)" class="requestSwitch" id="switch_<?php echo $row->ReqId ?>" title="switch">Approve Switch</i></a>
<?php endif;?>
</td>
<td>
<input class="del-checkbox" type="checkbox" name="checkbox[]" value="<?php echo $row->ReqId?>">
</td>
</tr>
<?php endforeach;?>
<?php endif?>
</tbody>
</table>
在的位置
oTable = jQuery("#requestt").dataTable( {
使用这个
oTable = jQuery("#requestt").DataTable( {
它会解决你的问题。。
如果你在之后遇到任何问题
用document.ready()
覆盖