Configurable class names
Configurable class names
zygimantas
Posts: 33Questions: 0Answers: 0
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]
[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]
This discussion has been closed.
Replies
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