Issue in footerCallback
Issue in footerCallback
zgoforth
Posts: 493Questions: 98Answers: 2
Link to test case: https://jsfiddle.net/BeerusDev/gbyks9r1/8/
I am trying to find an easier way to loop through all the days to get a count of all status so I can then create a simple switch statement to apply the count below my table instead of taking up like 160 lines in my other example. I call var data = this.data(), but it tells me in the next line data.flatMap is not a function? I am confused
This question has an accepted answers - jump to answer
Answers
You have this:
Inside the loop each
this
is one row meaningthis.data();
is the same asrow().data()
. Debugging your code therow().data()
is returning an object with that row's data.The flatMap() method is expecting an array of data not an object.
If you want an array of all the rows try replacing the loop with this:
The
toArray()
will return a standard Javascript array.Kevin
@kthorngren Thank you Kevin!
@kthorngren I am super stressed right now.. I cannot get it working. I accidentally deleted the fiddle in the OP and now I can't recreate what I had working, it tells me that rows() is not defined? https://jsfiddle.net/BeerusDev/gm10rqp7/355/