How know the columns names?

How know the columns names?

bakaynbakayn Posts: 14Questions: 0Answers: 0
edited October 2009 in General
in "fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ), How know the columns names?

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi bakayn,

    Not entirely sure what you are looking for - but given that you wrote the HTML, you will know the column names, so you can pull it out of aaData (or whatever) as required. Also you have the TR element for the footer so you could do something like $('th', nRow) if you wanted to get an array of the TH elements.

    Regards,
    Allan
  • bakaynbakayn Posts: 14Questions: 0Answers: 0
    i need know the column name when i'm working into of the function "fnFooterCallback".
    Have you a example? to get the column names.
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi bakayn,

    You've got two options:

    1. Query the DOM as I said before with something like: $('th', nRow)

    2. Get the columns information from the settings object:

    [code]
    var aoColumns = oTable.fnSettings().aoColumns;
    var sColumn1Title = aoColumns[0].sTitle;
    // etc
    [/code]
    Regards,
    Allan
This discussion has been closed.