map_table.rows is not a function
map_table.rows is not a function
ak47
Posts: 16Questions: 5Answers: 2
$("body").on 'click', "#map_button", ->
console.log $('[id$=listings_map_table]')
map_table = $('[id$=listings_map_table]').DataTable
console.log map_table
map_table.rows().every ->
The error is: Uncaught TypeError: map_table.rows is not a function
This is a page where the DataTable is created and drawn after the page is rendered based on user action. The table looks fine, and in my console I can see the object if I just spit the object to the console.
If I try to do an entire initialization, it tells me it can't reinitialize the table. But if I just do like the above, I get the ".rows is not a function" error.
What am I missing here?
Answers
The syntax looks a little unusual - I'm guessing it is transpiled into Javascript, but I don't recognise it. What is it?
should be:
is my guess, but it looks like whatever language it is, is trying to fill in parenthesis in places, and it isn't doing so there?
Allan
This is CoffeeScript. You're the man, that worked immediately!