Editor: Uncaught TypeError: Cannot read property 'create' of undefined

Editor: Uncaught TypeError: Cannot read property 'create' of undefined

atcclearsatcclears Posts: 24Questions: 7Answers: 0

I've just purchased the Editor and am trying to get a prototype working. I'm able to get the table to load using Ajax and JSON objects.

The New/Edit/Delete buttons appear too once the table is loaded.

When I click on New, nothing happens. I was expecting the form to pop up but there is nothing. While inspecting the page in Chrome, I am noticing the error:
Uncaught TypeError: Cannot read property 'create' of undefined

Chrome is saying it encountered this error on line 76 of dataTables.editor.min.js

If I select a row in the table and click on Edit or Delete, I get a similar error on line 76 for 'edit' and line 77 for 'delete'.

I've tried to emulate the situation here. The HTML is relatively simple and so is the the JavaScript for the prototype.
http://live.datatables.net/domimifo/1/edit

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    edited April 2015 Answer ✓

    Hi,

    Thanks for the code! The issue is with:

    editor: "NoteEditor"

    You want to pass in the NoteEditor instance, but at the moment it is just being given a string value.

    So you would use, for example:

        { sExtends: "editor_create", editor: NoteEditor },
    

    and that should do it!

    Regards,
    Allan

  • atcclearsatcclears Posts: 24Questions: 7Answers: 0

    Thanks, that worked.

    I was starting to bang my head against the wall... ;)

This discussion has been closed.