every is not a function

every is not a function

wilsontcwilsontc Posts: 6Questions: 2Answers: 1

I get a console error that 'every' is not a function. I'm trying to use it to see if any columns are hidden. In the following coffeescript method, length reports the correct number of columns, but then I get the 'every' error. 'msTable' is the datatable instance returned from DataTable().

    anyHidden = ->
      console.log "msTable.columns().data()length " + msTable.columns().data().length
      hiddenCols = false
      msTable.columns().every ->
        if !this.visible()
          hiddenCols = true
      return hiddenCols

This is on datatables 1.10.3.

This question has an accepted answers - jump to answer

Answers

  • wilsontcwilsontc Posts: 6Questions: 2Answers: 1
    Answer ✓

    The documentation for iterator() explains that every() is available in 1.10.6.

  • allanallan Posts: 63,679Questions: 1Answers: 10,498 Site admin

    Yup - rows().every() was introduced in 1.10.6.

    Allan

This discussion has been closed.