Editor - Latest Version

Editor - Latest Version

CMEDevCMEDev Posts: 6Questions: 1Answers: 0

When you buy the full package of editor does it come with a non-minified version? I'm unable to tell if this product will work for us because we are getting an error in the min code with editor:

TypeError: dt((W4 + s6) + y0a)[0] is undefined.

Is there an non-minified version we can test?

This question has accepted answers - jump to:

Answers

  • CMEDevCMEDev Posts: 6Questions: 1Answers: 0

    This happens when you try clicking on a cell.

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin
    edited July 2017 Answer ✓

    When you buy the full package of editor does it come with a non-minified version?

    Yes. The licensed version includes the source as well as a minified version. The trial is obfuscated and debugging it isn't the easiest thing as you are seeing!

    Can you show me the page and I might be able to spot what is going wrong. Possibly a table id that doesn't match?

    Allan

  • CMEDevCMEDev Posts: 6Questions: 1Answers: 0

    dataTables.editor.js:5681 Uncaught TypeError: Cannot read property 'oFeatures' of undefined

    This is the error we are getting. Unfortunately, right now I can't give you the site because it is password protected.

  • allanallan Posts: 63,893Questions: 1Answers: 10,531 Site admin

    Can you show me the code you are using to initialise DataTables and Editor please?

    Thanks,
    Allan

  • CMEDevCMEDev Posts: 6Questions: 1Answers: 0

    var editor; // use a global for the submit and return data rendering in the examples var fields = [ { label: "industry", name: "industry" }, { label: "occupation", name: "occupation" }, { label: "state", name: "state" }, { label: "harum", name: "harum" }, { label: "harum Notes", name: "harum Notes" }, { label: "fugit", name: "fugit" }, { label: "fugit Notes", name: "fugit Notes" }, { label: "nesciunt", name: "nesciunt" }, { label: "nesciunt Notes", name: "nesciunt Notes" }, { label: "pickle", name: "pickle" }, { label: "pickle Notes", name: "pickle Notes" } ]; $(document).ready(function() { editor = new $.fn.dataTable.Editor( { ajax: function ( method, url, data, success, error ) { }, table: "#example", fields: fields, formOptions: { inline: { onBlur: function(){ console.log("blurred!!!!!"); } } } }); var columns = [ { data: "industry" }, { data: "occupation" }, { data: "state" }, { data: "harum" }, { data: "harum Notes" }, { data: "fugit" }, { data: "fugit Notes" }, { data: "nesciunt" }, { data: "nesciunt Notes" }, { data: "pickle" }, { data: "pickle Notes" }, ]; var table = $('#regulations').DataTable( { dom: "Bfrtip", ajax: "", columns: columns, order: [ 1, 'asc' ], keys: { columns: ':not(:first-child)', keys: [ 9 ] }, select: { style: 'os', selector: 'td:first-child' }, buttons: [ { extend: "create", editor: editor }, { extend: "edit", editor: editor }, { extend: "remove", editor: editor } ] }); // Inline editing on click $('#regulations').on( 'click', 'tbody td:not(:first-child)', function (e) { editor.inline(table.cell(this).index(),{ buttons: '_basic' }); }); // Inline editing on tab focus table.on( 'key-focus', function ( e, datatable, cell ) { //editor.inline( cell.index() ); } ); $(".sf-dump").hide(); } ); var regulations = $('#regulation_list'); regulations.select2({ placeholder: 'Choose a regulation', }); function addOccupation() { $.ajax({ type:'post', url: '/admin/createOccupation', data: { _token: 'pEXP9mmFn5xLG6W2jBHybc8a3XtLjPQ6as9DRhr9', name: $('#occupation_name').val(), variables: regulations.val(), }, dataType: 'json', success: function(data) { console.log('submitted'); }, error: function(data, something, elses) { console.log(data); console.log(something); console.log(elses); console.log('Something\'s not quite right'); } }); }
  • CMEDevCMEDev Posts: 6Questions: 1Answers: 0

    I am pre-rendering the table with php loops.

  • kthorngrenkthorngren Posts: 21,592Questions: 26Answers: 5,006
    Answer ✓

    Looks like Allan was on track with the issue. You are initializing the Editor with this table: "#example", but your Datatables init is using this var table = $('#regulations').DataTable( {.

    Do you have a table called example?

    Kevin

  • CMEDevCMEDev Posts: 6Questions: 1Answers: 0

    Woops, stupid mistake! Thanks guys.

This discussion has been closed.