TypeError: cells is undefined

TypeError: cells is undefined

arsenarsen Posts: 2Questions: 1Answers: 0

Hey guys!

I have trouble with generated tables. When i build dataTable using static html table (which footer is static too), everything is just ok. BUT when i'm trying to add footer to it via jQuery, i get a huge error like TypeError: cells is undefined.
I double-checked — footer is generated in a proper way. HTML code of this two pages have no difference at all.
Reading of sources was also pretty useless.

Footer contains some radio and checkbox buttons. That's how i generate it:

generateFooter = ->
  range = [0…table.numberOfRows]
  $footer = $('<tfoot></tfoot>')
  for i in range
    $footer.append($(
      "<th>
        <label><input type='radio' name='as_x' data-column-number='#{i}'> <small>x</small> </label>
        <label><input type='checkbox' data-column-number='#{i}'> <small>y</small> </label>
      </th>"
    ))
  $('#table').append($footer)

It's coffeescript, but seems like markdown doesn't support it so i picked JS.

So, guys, i'm stuck here. Any help? :)

Answers

  • allanallan Posts: 63,364Questions: 1Answers: 10,449 Site admin

    I don't see a call to cells in your code anywhere. Can you link to the page showing the issue please.

    Allan

  • arsenarsen Posts: 2Questions: 1Answers: 0

    @allan — sorry, i don't get it. What do you mean by "the page showing the issue"? Source code of dataTables?

  • allanallan Posts: 63,364Questions: 1Answers: 10,449 Site admin

    No I mean, please give us the URL to the page so I can debug it. If you can't give me the URL, then use JSFiddle or http://live.datatables.net to create a test page showing the issue so it can be debugged.

    Allan

This discussion has been closed.