Generating TFOOT

Generating TFOOT

peterkronenbergpeterkronenberg Posts: 112Questions: 0Answers: 0
edited October 2010 in General
I am using Datatables to generate the THEAD row using aoColumns. How can I get the TFOOT section to be automatically generated?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    DataTables doesn't automatically generate a TFOOT. Perhaps this would be a nice option actually, when generated a header to add the footer as well. However, the easy way around it is just to use normal jQuery or DOM methods to create and insert the node as needed. $('#example').append('...'); for example.

    Allan
  • peterkronenbergpeterkronenberg Posts: 112Questions: 0Answers: 0
    Using normal Jquery or DOM doesn't quite work if there are columns hidden with ColVis. Is there a way to retrieve all the columns, hidden or not?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You need to create the element before initialising DataTables if using hidden columns. It's possible to add it after initialisation, but much harder.

    Allan
  • peterkronenbergpeterkronenberg Posts: 112Questions: 0Answers: 0
    The problem is I am letting DataTables create everything. The only solution I can see is to hide the columns after initialization, using fnSetColumnVis instead of bVisible.
  • peterkronenbergpeterkronenberg Posts: 112Questions: 0Answers: 0
    Hmm, actually, this still doesn't seem to work since ColVis does not know about the tfoot and is therefore not properly adjusting it when columns are hidden.
This discussion has been closed.