1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-27 00:54:15 +01:00

New - init option: classes option can be used to modify the classes

object

- Previously to modify the class names that DataTables uses for its
  components you has to use $.fn.dataTable.ext.oStdClasses. Now you can
  use the `classes` initialisation option which will extend the classes
  object of the DataTable.

- This fixes issue #180.
This commit is contained in:
Allan Jardine 2013-06-17 12:05:07 +01:00
parent 5cecbb5528
commit d2755c4037
2 changed files with 13 additions and 2 deletions

View File

@ -172,7 +172,7 @@ if ( oInit.bJQueryUI )
/* Use the JUI classes object for display. You could clone the oStdClasses object if
* you want to have multiple tables with multiple independent classes
*/
$.extend( oSettings.oClasses, DataTable.ext.oJUIClasses );
$.extend( oSettings.oClasses, DataTable.ext.oJUIClasses, oInit.oClasses );
if ( oInit.sDom === DataTable.defaults.sDom && DataTable.defaults.sDom === "lfrtip" )
{
@ -182,7 +182,7 @@ if ( oInit.bJQueryUI )
}
else
{
$.extend( oSettings.oClasses, DataTable.ext.oStdClasses );
$.extend( oSettings.oClasses, DataTable.ext.oStdClasses, oInit.oClasses );
}
$(this).addClass( oSettings.oClasses.sTable );

View File

@ -1483,6 +1483,17 @@ DataTable.defaults = {
"iTabIndex": 0,
/**
* Classes that DataTables assigns to the various components and features
* that it adds to the HTML table. This allows classes to be configured
* during initialisation in addition to through the static
* {@link DataTable.ext.oStdClasses} object).
* @namespace
* @name DataTable.defaults.classes
*/
"oClasses": {},
/**
* All strings that DataTables uses in the user interface that it creates
* are defined in this object, allowing you to modified them individually or