简体   繁体   中英

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)

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。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM