Assign column names via an attribute in ?
Assign column names via an attribute in ?
I have a code base where I have a few tables of variable widths, all running the same server-side processing methods. I need to assign column names, but due to the static nature of aoColumns or aoColumnDefs, I can't use them.
Is there a way to have DT read custom attributes on the tag for the column names to send with the server-side data? Something like Name. Clicking the sort column would send the "username" column name.
Is there a way to have DT read custom attributes on the tag for the column names to send with the server-side data? Something like Name. Clicking the sort column would send the "username" column name.
This discussion has been closed.
Replies
Allan
I would like some way for DT to assign sName column names based on a custom attribute in .
That does sound sensible. I'm afraid that it isn't possible at the moment, but for 1.10 I'm going to be looking at increasing how sName can be used in the API, and this ability will be one of the things that I look at.
Allan
[code]
fnServerData: function ( source, data, callback ) {
var headers = [];
$('thead th', this).each(function() {
headers.push($(this).attr('dtName'));
});
....
[/code]