Problem with Editor plugin initialization

Problem with Editor plugin initialization

yetyet Posts: 43Questions: 17Answers: 1

I have an existing implementation using DT 1.10.15 (latest). Now I am trying to add the editor plugin

My working initialization code (without the editor functionality) is:

https://gist.github.com/zopyx/c82fdf7312a9d803f46eae9c6ec4ccc8

As soon as I add the 'buttons' and 'columns' to the options I receive an error

jquery.dataTables.js:1197 Uncaught TypeError: Cannot read property 'mData' of undefined
at HTMLTableCellElement.<anonymous> (jquery.dataTables.js:1197)
at Function.each (++resource++plone.app.jquery.js:2)
at init.each (++resource++plone.app.jquery.js:2)
at HTMLTableElement.<anonymous> (jquery.dataTables.js:1194)
at Function.each (++resource++plone.app.jquery.js:2)
at init.each (++resource++plone.app.jquery.js:2)
at init.DataTable [as dataTable] (jquery.dataTables.js:869)
at init.$.fn.DataTable (jquery.dataTables.js:15172)
at HTMLDocument.<anonymous> (kataster-view:7851)
at o (++resource++plone.app.jquery.js:2)

What's going on here?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,258Questions: 1Answers: 10,421 Site admin

    Does your HTML for the table only have two column?

    Allan

  • yetyet Posts: 43Questions: 17Answers: 1

    No, it does not...but the least thing to expect in such an error condition is a reasonable error message and some reasonable error checking.

  • yetyet Posts: 43Questions: 17Answers: 1

    The table has 8 columns.

    So I added 8 pseudo columns to the code (updated)

    https://gist.github.com/zopyx/801b1064a876fe2b468760e8fa818747

    Now the error is

    dataTables.buttons.js:814 Uncaught Cannot extend unknown button type: selected

  • yetyet Posts: 43Questions: 17Answers: 1

    ok, I needed to included the SELECT extension.

    The editor is now working but the export buttons for PDF/CSV etc. disappeared..

  • kthorngrenkthorngren Posts: 21,186Questions: 26Answers: 4,925
    Answer ✓

    The only buttons I see defined are for the Editor:

                buttons: [
                    { extend: 'create', editor: editor },
                    { extend: 'edit',   editor: editor },
                    { extend: 'remove', editor: editor }
                ],
    

    You will need to add the export buttons you wish to display.

    Kevin

This discussion has been closed.