How to select all editors in a page

How to select all editors in a page

qshngqshng Posts: 9Questions: 5Answers: 0
edited March 2019 in Free community support

Hi,
I'm new to datatbale. I have multiple datatables each with an Editor in a page, and I want to bind an event to all the editors.

Is there such a function as $.fn.dataTable.tables() which works for editors? Or any better ways to do this?

My editors are defined as below. How do I select all editors without explicitly pass in all the variable names?

     editor1 = new $.fn.dataTable.Editor({
          table: '#table1'
     });
     editor2 = new $.fn.dataTable.Editor({
          table: '#table2'
     });
     editor3 = new $.fn.dataTable.Editor({
          table: '#table3'
     });

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Currently no - there isn't an API that will operate over multiple Editor instances as there is for DataTables i'm afraid. If you want to attach an event to all three, you'd need to apply that event listener to each individually. They can call the same function, but you'd need to apply the listener individually.

    Allan

This discussion has been closed.