Reopening page on Codeigniter -


i trying reopen same page on codeigniter. see code below:

<?php class leads extends ci_controller { public $tempname; public $tempfrom; public $tempto;  public function index() {     $this->load->model('lead');     $leads = $this->lead->getallleads();     $pagenum = count($leads);     $this->load->view('main', array('leads' => $leads, 'pagenum' => $pagenum)); }  public function getleads(){     $this->load->model('lead');     $name = $this->input->post('name');     $from = $this->input->post('from');     $to = $this->input->post('to');     $leads = $this->lead->getleads($name, $from, $to);     $pagenum = count($leads);     $this->load->view('main', array('leads' => $leads, 'pagenum' => $pagenum)); } } ?> 

as can see, first open 'main' 'index()'. in main, call 'getleads()', page not getting updated. because can't refresh data while on same page? if yes, how can work around it? lot!

you cannot call controller view. sounds should using ajax in "main" view additional data getleads().


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -