Help please
Help please
ShadowAssassin
Posts: 4Questions: 0Answers: 0
Hello. I am using Codeigniter, and I need some help with Datatables.
Basically, I am getting the ID from the database, and it's in the datatable.
I have a column for deleting the item (files in this instance).
My code for this is: (I have set $custom)
$edit = '';
I want filename to either by equal to the name of the file (in the filename column) or the ID. (so $filename = 1, 2, 3, 4 etc)
How do I set $filename? I mean, I've tried a for loop, and everything. I've even tried using jQuery, and setting a class for the ID column and using the .click function, but it didn't work.
Any help is greatly greatly appreciated :) Thank you.
Basically, I am getting the ID from the database, and it's in the datatable.
I have a column for deleting the item (files in this instance).
My code for this is: (I have set $custom)
$edit = '';
I want filename to either by equal to the name of the file (in the filename column) or the ID. (so $filename = 1, 2, 3, 4 etc)
How do I set $filename? I mean, I've tried a for loop, and everything. I've even tried using jQuery, and setting a class for the ID column and using the .click function, but it didn't work.
Any help is greatly greatly appreciated :) Thank you.
This discussion has been closed.
Replies
Allan
I need to set $filename.
Basically, I need to get the ID's and for each ID, make $filename = $ID.
So, I have the table
ID: 1
Column2
Column3
Delete (image link)
ID: 2
Column2
Column3
Delete (image link)
And so on so fourth, the link of the delete image, needs to be equal to the ID.
Allan
(https://github.com/IgnitedDatatables/Ignited-Datatables)
Allan
{name} is just example.
$filename needs to contain each of the ID's. so foreach($query->result() as $row) {
$filename = $row->id;
}
that works, but only gives me one ID across all tables. (so each delete link has the ID of 1, rather then each one being 1, 2, 3, 4)