Multiple header rows and colspans using dynamic creation example

Multiple header rows and colspans using dynamic creation example

mherodevmherodev Posts: 4Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Is there a way to pass in multiple header rows and add colspans while using dynamic creation rather than having DataTables read from the DOM? I'm trying to optimize rendering of a very large table (20,000 rows) and I feel that feeding in the data directly would have a huge gain in performance. I'm just not sure if that is already supported, or if support would need to be added by a plugin.

Best
Michael

Replies

  • mherodevmherodev Posts: 4Questions: 0Answers: 0
    From this example: http://www.datatables.net/release-datatables/examples/data_sources/js_array.html
  • mherodevmherodev Posts: 4Questions: 0Answers: 0
    edited May 2013
    To clarify, since I know you prefer code examples:

    http://live.datatables.net/osaqon/4/edit

    Right now, it appears as if adding extra columns simply breaks the table, assuming the columns are law and the data should match. As such, an "expected width in columns" value could be passed in, as well as a colspan value for each column (defaults to 1) as to allow this rendering.

    Not sure if I'm missing some implementation of this elsewhere.
  • mherodevmherodev Posts: 4Questions: 0Answers: 0
    edited May 2013
    Figured out a compromise of sorts:

    If I render the headers to HTML and read from them, I can still replace the data with aaData. Gets around my inability to figure out how to pass in multiple rows and colspans directly.

    Hope this helps anyone else who may end up here.

    http://live.datatables.net/osaqon/6/edit
This discussion has been closed.