I wish to return one of my datatables editor data columns as a page heading
I wish to return one of my datatables editor data columns as a page heading
Datatables Editor returns data.username from one of my tables (a foreign key), but it seems pointless to display this same name on every row of my table.
Can I use this to fill an element.InnerHtml on my html page so the username appears once at the top of the page?
Currently I make a separate ajax call to a php script to fill this but that seems so wasteful.
I've tried declaring a javascript variable and populating it from the editor fields and columns definition scripts but I can't get it to work.
Any clues?
This question has an accepted answers - jump to answer
Answers
You can hide the column and use the
initComplete
option, like this:To be clear, that takes the username from the first row.
Documentation:
initComplete
columns
columns.visible
row().data
Awesome. Many thanks.
This is what I finally used: