[英]I need to refresh my view in codeigniter
When I click on PatymentRecieved
left_menu link than we go to PatymentRecieved
view and select shopId from shop dropDown ,basis of shopId we get customer name in another dropDown if we select any customer name from this customer dropdown than result generated in table though ajax response,The problem is that IFF we come to shopID dropdown than we select ="select"
also in customer name dropdown select ="Select"
than we need to refresh my view (table data ajax response) 当我单击
PatymentRecieved
left_menu链接时,我们转到PatymentRecieved
视图,并从shop dropDown中选择shopId,基于shopId的shopId我们会在另一个dropDown中获得客户名称,如果我们从该客户下拉列表中选择任何客户名称而不是通过ajax响应在表中生成的结果,问题是,IFF我们来shopID下拉比我们选择="select"
也于客户名称下拉列表中选择="Select"
比我们需要刷新我的看法(表数据Ajax响应)
public function selectCustById(){
//check iff in shop dropDown shopId="Select"
if($this->input->post('shopId')=="Select"){echo "<option>Select</option>";}
$shop_id=$this->input->post('shopId');
$data['custName']=$this->transaction_model->getCustNameByshopId();
$i=0;
foreach ($data['custName'] as $custName) {
if($i==0){
echo "<option>Select</option>";
}
echo "<option value='$custName->id'>$custName->name</option>";
}
$i++;
}
在下拉菜单中选择"select"
后,只需将以下javascript代码放在下面
window.location.reload();
window.location.reload(true);
在选中两个下拉列表中选择的值为“ select”后,将使用上述javascript。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.