简体   繁体   English

我需要在Codeigniter中刷新视图

[英]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.

相关问题 在刷新之前,无法在Codeigniter中上载和调整大小的照片在视图中可用..视图加载是否“过快”? - Uploaded and resized photo in Codeigniter is not available in view until I refresh .. is my view loading “too fast”? 我需要从数据库中获取数据并使用php codeigniter在我的视图中显示 - I need to fetch data from database and display in my view using php codeigniter Codeigniter-Ajax我需要返回多个行以及如何在我的视图文件中访问它 - Codeigniter-Ajax i need to return more than one rows and how to access it in my view file 当我刷新页面时,它会自动将值输入到数据库Codeigniter - When i refresh my page it automactically input values to the database Codeigniter 我需要在view -Codeigniter中调用控制器函数 - I need to call a controller function inside a view -Codeigniter Codeigniter是否需要检查视图中是否设置了变量? - Codeigniter Do I need to check if a variable is set in view? 我无法在Codeigniter的视图中访问控制器阵列 - I cant access my controller array in my view in codeigniter 我在Codeigniter中的侧边栏菜单活动类中需要JavaScript - i need JavaScript for my sidebar menu active class in codeigniter 我需要在模型codeigniter中设置第二个数据库 - I need set second database in my model codeigniter 我需要将SQL SERVER连接到我的codeigniter项目 - I need to connect SQL SERVER to my codeigniter project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM