Codeigniter-DataTables icon indicating copy to clipboard operation
Codeigniter-DataTables copied to clipboard

Adding HTML through AJAX processing results

Open abydahana opened this issue 10 years ago • 1 comments

Hello. I was downloaded and implementing this library into my own application. It's works until I got confused then. You know, my table results should adding options to handle any rows. For example there is "User" table. So it's row should have option to manage user such "Edit", "View" or "Delete".

How to implements my idea? Is it can be done from model?

Thank you, Regards

abydahana avatar Nov 06 '15 17:11 abydahana

Ok, I'm done with this:

columns:[
  {
    data: null,
    defaultContent: '<span class="btn btn-info btn-edit btn-xs">Edit</span>',
    orderable: false,
    searchable: false
  },
  {data: "st_name"},
  {data: "st_address"},
  {data: "st_city"},
  {data: "st_state"},
  {data: "st_zip"},
  {data: "st_phone"}
]

But how to fetching a unique ID from database?

<a href="edit/st_phone"><span class="btn btn-info btn-edit btn-xs">Edit</span></a>

st_phone mean to getting unique phone from database results. It's should returning "edit/099123456". How do you can done with that?

abydahana avatar Nov 07 '15 12:11 abydahana