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

python - argument must be rect style object - Pygame -

webrtc - Which ICE candidate am I using and why? -

c# - Better 64-bit byte array hash -