Adding non-database items to server-side DataTable

Adding non-database items to server-side DataTable

PixelElephantPixelElephant Posts: 2Questions: 0Answers: 0
edited April 2012 in DataTables 1.9
I have a DataTable that I would like some of the elements to be non-database items.

Here is my table:

[code]



Details
First Name
Last Name
Delete




[/code]

Here is my DataTable:

[code]
$(document).ready(function(){
oTable = $('#oTable').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": 'GetInfo.php'
});
});
[/code]

I am using the default PHP script that comes with DataTables.

I would like First Name and Last Name columns to be populated from the database (serverside) and Details and Delete columns will just have buttons in them. This seems like it should be easy to do, but I can't figure it out.

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    I think sDefaultContent is probably the option you want here - just put the HTML you want to use for the two columns into that and that will do it.

    Allan
  • PixelElephantPixelElephant Posts: 2Questions: 0Answers: 0
    That didn't work but I ended up getting it to work with your example here http://www.datatables.net/release-datatables/examples/api/row_details.html

    Thanks for DataTables - it is really awesome!
This discussion has been closed.