Welcome Guest, Not a member yet? Register   Sign In
Ignited Datatables - display the records on the table
#3

(This post was last modified: 09-23-2015, 03:02 AM by Lykos22.)

(09-21-2015, 10:38 PM)salain Wrote: Hi,

You need to change your controller to this to work:



PHP Code:
public function index() {

 
      $this->data['datatables'] = true;
 
      $this->data['data_url'] = 'admin/get_post_datatables';
 
      
       
       
// load view
 
      $this->load->view('admin/posts/index'$this->data);
 
  }
Public function 
get_post_datatables(){
 
 echo $this->post_model->get_datatable();


Thank you for your reply. I 've done some changes on my code so you can review it

PHP Code:
**
 
   * List all posts
    
*/
 
   public function index() {

 
       $this->data['datatables'] = true;

 
       $this->data['data_url'] = 'admin/posts/datatables_ajax';
 
       // $this->data['posts'] = $this->post_model->get_datatable();
 
       // dump($this->data['pages']);

 
       // load view
 
       $this->load->view('admin/pages/index'$this->data);
 
   }

 
   public function datatables_ajax() {
 
       $this->output->enable_profiler(false);
 
       $this->data['posts'] = $this->post_model->get_datatable();
 
       // echo $this->data['posts'];
 
   

I've put it on a separate function, as you said before but still same thing
Reply


Messages In This Thread
RE: Ignited Datatables - display the records on the table - by Lykos22 - 09-22-2015, 01:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB