Custom field-extension throws error "Cannot read properties of undefined (reading 'oFeatures')"

Custom field-extension throws error "Cannot read properties of undefined (reading 'oFeatures')"

VolkhardVVolkhardV Posts: 17Questions: 4Answers: 0

Hello,

1) at https://customer.vogeler-ag.de/vag/test/test.html is a demonstration
2) you can mark the 1st record "Name1" and goto "Ändern". In editor-form you see the fields "Name" and "Kategorien".
3) Add a new Category with button "New". After pressing "Create" the new dialog freezes. In Konsolen-window of the browser is this error-message:
dataTables.editor.js:645

   Uncaught TypeError: Cannot read properties of undefined (reading 'oFeatures')
at __dtIsSsp (dataTables.editor.js:645)
at Editor.create (dataTables.editor.js:849)
at Editor._dataSource (dataTables.editor.js:3933)
at Editor._submitSuccess (dataTables.editor.js:4980)
at dataTables.editor.js:4843
at Editor._submitTable (dataTables.editor.js:4896)
at dataTables.editor.js:4842
at Editor._event (dataTables.editor.js:4099)
at Editor._submit (dataTables.editor.js:4833)
at dataTables.editor.js:3232

Can anyone help?

best regards

Volkhard

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 55,108Questions: 1Answers: 8,653 Site admin
    Answer ✓

    Hi Volkhard,

    Thanks for the test case! The problem is coming about due to the use of:

    table: "#Categories",
    

    Most of the time that is okay, but it requires the table to be actually in the document, which it isn't at the point of submission of the categories, since Editor has removed it from the DOM.

    So what we need to do is use the table node instead. In your create function do:

                    "create": function (conf) {
                        var that = this;
                        conf.categoryTable = null;
    
                        conf._enabled = true;
    
    
                        conf._input = $('#tplCategories')[0];
                        var tbl = $('#Categories')[0];
                        conf.catEditor = new editor({
                            table: tbl,
                            idSrc: "id",
    

    I believe that should resolve the error.

    Allan

  • VolkhardVVolkhardV Posts: 17Questions: 4Answers: 0

    Hello Allan,
    thanks - it works :)

    best regards
    Volkhard

Sign In or Register to comment.