Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Ignited Datatables - button links don't work in add_column()
#1

(This post was last modified: 09-28-2015, 01:14 AM by Lykos22.)

I'd like some help please. I'm using Ignited Datatables library in order to display posts. My script at the begining was looking like this

PHP Code:
$this->datatables->select('posts.id, posts.title')->select('DATE_FORMAT(`date_published`, \'%d-%m-%Y\') AS `date_published`'false)
 
       ->from('posts')
 
       ->unset_column('id')
 
       ->add_column('Actions'btn_edit('admin/posts/edit/$1') . ' ' btn_delete('admin/posts/delete/$1'), 'id'); // this is the part I'm considering
 
      echo $this->datatables->generate(); 

so basicly in the add_column() I'm generating some button links to edit and delete posts and the urls of these buttons would look like this:

Code:
admin/posts/edit/1
admin/posts/delete/1

So far so good, but when I tryied to JOIN the post categories in the query

PHP Code:
$this->datatables->select('posts.id, posts.title')->select('DATE_FORMAT(`date_published`, \'%d-%m-%Y\') AS `date_published`'false)
 
       ->select('posts_categories.title as category')
 
       ->from('posts')
 
       ->join('posts_categories''posts.category_id = posts_categories.id''left')
 
       ->unset_column('id')
 
       ->add_column('Actions'btn_edit('admin/posts/edit/$1') . ' ' btn_delete('admin/posts/delete/$1'), 'id');
 
       echo $this->datatables->generate(); 

the urls of the button links broke and I get this, which goes to 404 page:

Code:
admin/posts/edit/id
admin/posts/delete/id

How can I fix this?
Reply


Messages In This Thread
[SOLVED] Ignited Datatables - button links don't work in add_column() - by Lykos22 - 09-27-2015, 09:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB