【发布时间】:2017-02-02 05:19:06
【问题描述】:
我想使用所需列(如城市)上的数据表下拉列表来过滤列表
<table class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>Sl.no</th>
<th>Principle</th>
<th>City</th>
<th>Branch Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $i=1; foreach($branchDetails as $branch) {?>
<tr>
<td><?php echo $i;?></td>
<td class="center"><?php echo $branch->principle_name;?></td>
<td class="center"><?php echo $branch->city_name;?></td>
<td class="center"><?php echo $branch->branchName;?></td>
<td class="center">
<a href="<?php echo base_url();?>admin/Branch/edit/<?php echo $branch->branchId ; ?>">
<i class="icon-edit"></i>
</a>
<!--<a href="#" data-id="<?php echo $branch->branchId;?>">
<i class="icon-trash"></i>
</a>-->
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
数据表js是
$('.datatable').dataTable({
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span12'i><'span12 center'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
}
} );
我如何实现在此显示下拉过滤器。
【问题讨论】:
-
点击这些链接,它可能会解决您的问题。 stackoverflow.com/questions/7046308/…stackoverflow.com/questions/28494355/…
标签: php codeigniter datatables