Applying a theme on a DataTable with extras

Applying a theme on a DataTable with extras

mecabmecab Posts: 9Questions: 2Answers: 0
edited March 2014 in General
Hi every body
When i want to apply a theme using ThemeRoller it works just fine , but when i do it while having extras on my table like ColVis and TableTools the theme isn't applyed anymore .
can some one show me an exemple where he uses an extra and a theme and it does work perfectly ?

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    You need to make sure you modify the sDom option correctly. For jQuery UI the default is: `<"H"lfr>t<"F"ip>` . Modify that to add in the extras you want. i.e. add `T` for TableTools etc.

    Allan
  • mecabmecab Posts: 9Questions: 2Answers: 0
    let me try to explain more Allan :
    this of course works fine with the theme
    [code]
    $(document).ready( function () {

    $('#table_NRubriques').dataTable( {
    "bJQueryUI": true,
    } );
    } );
    [/code]
    while this
    [code]
    $(document).ready( function () {

    $('#table_NRubriques').dataTable( {
    "bJQueryUI": true,
    "sDom": 'RCT<"clear">lfrtip',
    "oColVis": {
    "bRestore": true
    },
    "oTableTools": {
    "sSwfPath": "/Projet/DataTables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",


    },

    "sPaginationType": "two_button"
    } );
    } );
    [/code]
    functions well ( the extras are working fine) but the theme isn't applied anymore
    Can you tell me if i did something wrong ?
  • mecabmecab Posts: 9Questions: 2Answers: 0
    Well it seems that i didn't read well Allan's response, so yeah it's all in the sDom . in order for the theme to work well i just changed this [code] "sDom": 'RCT<"clear">lfrtip', [/code]
    to this [code] "sDom": 'CR<"clear"><"H"lfr>t<"F"Tip>', [/code] in case anyone had the same noobie probleme :p (of course C , R and T are the extras i used and their order isn't important , just a matter of how you want it to be displayed )
This discussion has been closed.