0
我有三个视图文件夹视图和我想用Ajax调用通过点击链接中的按钮来显示类别表和产品表... input.php
同时显示表中的数据负载表调用笨
<div class="wrapper">
<div class="container">
<div class="jumbotron">
<h1>View Two Records By Click Event</h1>
</div>
<div id="show-catg">
<?php $this->load->view('show'); ?>
</div>
<div id="show-prd">
<?php $this->load->view('show_pro'); ?>
</div>
,但我想这显示使用单击事件..喜欢
<a href="" class="show_catg">Categories</a>
<a href="" class="show_prd">Product</a>
$('.show_catg').click(function(){
url:,
data:,
});
$('.show_prd').click(function(){
url:
data:
});
这是5月控制器类功能
public function index(){
$data= $this->Model_data->getAll_categories();
$data1 = $this->Model_data->getAll_product();
$Dataa = array('categories' => $data,"products"=>$data1);
$this->load->view('input',$Dataa);
}
Model_data类
function getAll_categories(){
$this->db->select('*');
$this->db->from('categories');
$this->db->limit(50);
$this->db->order_by('Catg_ID','ASC');
$query = $this->db->get();
return $query->result();
}
public function getAll_product(){
$this->db->select('*');
$this->db->from('product');
$this->db->limit(50);
$this->db->order_by('Prod_ID','ASC');
$query = $this->db->get();
return $query->result();
}
没事做类似的方式..但真的需要帮助....:| – Khushi