Editor: "Cannot read property 'fnSelectNone' of null" after delete using JQuery UI Styling

Editor: "Cannot read property 'fnSelectNone' of null" after delete using JQuery UI Styling

BaconbaconBaconbacon Posts: 2Questions: 1Answers: 0

I've come across this Uncaught Exception error on dataTables.editor.js:377 after using Editor to delete an entry in my table using Jquery UI. This error also exists in the example: http://editor.datatables.net/examples/styling/jqueryui.html

If an entry is deleted, it processes and deletes correctly, but any subsequent delete requests fail using Jquery UI styling. Because this error exists in the example, I'm not sure if it is a bug or not. My code is the same as the example.

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    Hi,

    Apologies for this - very certainly a bug. I've got a fix for this already, and I'll be releasing 1.3.2 with the fix soon. However, until then, use the following in place of the editor.jqueryui.js integration file that Editor comes with (i.e. just replace the contents of the existing file completely with this):


    (function(){ var Editor = $.fn.dataTable.Editor; Editor.defaults.display = "jqueryui"; Editor.display.jqueryui = $.extend( true, {}, Editor.models.displayController, { "init": function ( dte ) { dte.__dialouge = $('<div></div>') .css('display', 'none') .appendTo('body') .dialog( $.extend( true, Editor.display.jqueryui.modalOptions, { autoOpen: false, buttons: { "A": function () {} } // fake button so the button container is created } ) ); // Need to know when the dialogue is closed using its own trigger // so we can reset the form $(dte.__dialouge).on( 'dialogclose', function (e) { dte.close('icon'); } ); $(dte.dom.formError).appendTo( dte.__dialouge.parent().find('div.ui-dialog-buttonpane') ); return Editor.display.jqueryui; }, "open": function ( dte, append, callback ) { dte.__dialouge .append( append ) .dialog( 'open' ); dte.__dialouge.parent().find('.ui-dialog-title').html( dte.dom.header.innerHTML ); // Modify the Editor buttons to be jQuery UI suitable var buttons = $(dte.dom.buttons) .children() .addClass( 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' ) .each( function () { $(this).wrapInner( '<span class="ui-button-text" />' ); } ); // Move the buttons into the jQuery UI button set dte.__dialouge.parent().find('div.ui-dialog-buttonset') .empty() .append( buttons ); if ( callback ) { callback(); } }, "close": function ( dte, callback ) { if ( dte.__dialouge ) { dte.__dialouge.dialog( 'close' ); } if ( callback ) { callback(); } } } ); Editor.display.jqueryui.modalOptions = { width: 600, modal: true }; })();

    Regards,
    Allan

  • BaconbaconBaconbacon Posts: 2Questions: 1Answers: 0

    I am now getting this same error in datatables.editor.js

This discussion has been closed.