Multiple editors?

Multiple editors?

bvelasquezbvelasquez Posts: 28Questions: 7Answers: 0

Is it possible to have multiple editors on the same page?
If so, what is the correct way to do it?

This question has accepted answers - jump to:

Answers

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

    I just give each editor instance a unique name, like:

    editorName = new $.fn.dataTable.Editor( {
    //...
    

    Then use the name to refer to it, of course. Is that what you mean?

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin
    Answer ✓

    @Enaldi is spot on. You just need to create multiple Editor instances and assign them to variables like you would with any other object instance.

    Allan

  • bvelasquezbvelasquez Posts: 28Questions: 7Answers: 0

    Thank you Enaldi ~ for some reason I was having issues but all looks good now!

  • sburckhardtsburckhardt Posts: 1Questions: 0Answers: 1
    Answer ✓

    There are no examples of having multiple tables and retrieving the Editor from the DataTable.

    However, it is the same as for when there is a single table on the page.

    Beware: you must define the Editor first.

    The editor() docs stae

    The Editor instance used by this method is the last Editor instance create that refers to this table when the table was constructed. This consideration is only important when using multiple Editor instances

    Otherwise you will get an undefined value from .editor()

This discussion has been closed.