Php 如何在codeigniter下拉列表中放置快速过滤器,以帮助快速过滤与每个表相关的结果
我想把快速过滤器放在我的桌子上。因此,需要有许多下拉列表来帮助快速筛选与每个表相关的结果。我怎么做呢 这是我的视图文件:Php 如何在codeigniter下拉列表中放置快速过滤器,以帮助快速过滤与每个表相关的结果,php,codeigniter,Php,Codeigniter,我想把快速过滤器放在我的桌子上。因此,需要有许多下拉列表来帮助快速筛选与每个表相关的结果。我怎么做呢 这是我的视图文件: <div class="row-fluid sortable"> <div class="box span12"> <div class="box-header" data-original-title> <div clas
<div class="row-fluid sortable">
<div class="box span12">
<div class="box-header" data-original-title>
<div class="box-icon">
<a href="#" class="btn-setting"><i class="halflings-icon wrench"></i></a>
<a href="#" class="btn-minimize"><i class="halflings-icon chevron-up"></i></a>
<a href="#" class="btn-close"><i class="halflings-icon remove"></i></a>
</div>
</div>
<div class="box-content">
<table id="segment" class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>UNSPSC SEGMENT</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<?php foreach($dash_present_all_selected_suppliers as $v): ?>
<tr>
<td class="center" style="color:#0c595b;"><a href="<?php echo base_url(); ?>admin/dashboard1/select_segment?segment=<?php echo $v->name;?>"><?php echo $v->name;?> </a> </td>
<td class="center">70%</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div><!--/span-->
</div><!--/
仅供参考,您可以将URL的URI段放在
base_URL()
中以保存运行并提高可读性,例如:
变为:
@rosswillson谢谢您的回复,但是我如何创建快速过滤器作为下拉列表来帮助快速过滤结果?您所说的快速过滤器到底是什么意思?i、 他们在过滤什么?您使用什么标识符来筛选它们?您要筛选的所有内容都已在页面上,还是必须从服务器获取更多数据?您是否有可能最终拥有一个大型数据集?在您的视图中,您有指向select_segment
的链接,但在您的控制器中,我只能看到select_supplier
这些链接是相同的还是您希望将这些链接更改为selects?始终尝试为你的应用程序正在做什么以及你想从中得到什么添加一点背景知识。@Rosswelson嘿,谢谢你的回复。我在视图文件中使用的select_段用于保留已选择的行。现在我也使用flashdata来保存它。我想要的就是像datatables中的这个链接一样检查过滤器。您愿意为此使用datatables吗?
public function __construct() {
parent::__construct();
$this->load->library('form_validation');
$this->load->model('dash_match_model');
$this->load->library('session');
$this->load->helper('url');
}
public function index() {
$arr['page']='dash1';
$user_id = $this->session->userdata('id');
$supplier = $this->dash_match_model->dash_present_all_suppliers($user_id);
$arr['dash_present_all_suppliers'] = $supplier;
$this->load->view('clients/clDashboard',$arr);
}
public function select_supplier()
{
$supplier_name = $this->input->get('name', TRUE);
$supplier_id="";
$supplier_sel = $this->dash_match_model->selected_supplier_id($supplier_name);
foreach ($supplier_sel->result() as $row){
$supplier_id = $row->supplier_id;
}
$selected_supplier = $this->dash_match_model->unspsc_matched_skus($supplier_id);
$arr['dash_present_all_selected_suppliers'] = $selected_supplier;
$this->load->view('clients/unspscSegment', $arr);
}