Configurable class names

Configurable class names

zygimantaszygimantas Posts: 33Questions: 0Answers: 0
edited April 2009 in General
Is it possible to extend future versions of DataTables plugin to allow configuration of class names on generated elements? Sample implementation might be:

[code]
(function($) {
$.extend($.fn, {
dataTable: function(oSettings) {
if (typeof oSettings.asClasses !== 'undefined') {
asClasses.sInfo = oSettings.asClasses.sInfo || asClasses.sInfo;
//...
asClasses.sWrapper = oSettings.asClasses.sWrapper || asClasses.sWrapper;
}

//...
}
});

var asClasses = $.fn.dataTable.asClasses = {

sInfo = 'dataTables_info',
//...
sWrapper = 'dataTables_wrapper'
};

})(JQuery);
[/code]

It would be possible to use it this way:

[code]
oTable.dataTable( {

'asClasses': {
'sInfo': 'my_custom_info_class_name',
//...
'sWrapper': 'my_custom_wrapper_class_name'
}

//...
});
[/code]

Replies

  • allanallan Posts: 57,679Questions: 1Answers: 9,193 Site admin
    Hi zygimantas,

    Yes this does sound like quite an attractive option for future versions of DataTables. I've got it on my to do list (which is getting rather long... Ah for a 26 hour day...).

    Regards,
    Allan
This discussion has been closed.