getting some error while using editor js, trial versions

getting some error while using editor js, trial versions

kumar_endeavourkumar_endeavour Posts: 5Questions: 3Answers: 0

Hello,
i am trying to use the editor trial version prior to purchase. I have Downloaded the trial version and using the same.
I am getting this error "TypeError: this[v2L][l9] is undefined "

My html is following

Order orderType Type Created To Receiver
Order orderType Type Created To Receiver

My JS is following

var editor;

$(document).ready(function() {

editor = new $.fn.dataTable.Editor( {
    ajax: "viewOrder.do?method=listOfOrders",
    table: "#tabledata",
    fields: [ {
            label: "Order:",
            name: "orderId"
        }, {
            label: "Type:",
            name: "orderType"
        }, {
            label: "Type:",
            name: "original"
        }, {
            label: "Created:",
            name: "creationDate",
            type:"data"
        }, {
            label: "receiver_mcSupplierno:",
            name: "receiver_mcSupplierno"
        }, {
            label: "To:",
            name: "receiver_name"
        }
    ]
} );

 editor
 .on( 'open', function ( e, type ) {
     if ( type === 'inline' ) {
         // Listen for a tab key event when inline editing
         $(document).on( 'keydown.editor', function ( e ) {
             if ( e.keyCode === 9 ) {
                e.preventDefault();

                 // Find the cell that is currently being edited
                 var cell = $('div.DTE').parent();

                 if ( e.shiftKey && cell.prev().length && cell.prev().index() !== 0 ) {
                     // One cell to the left (skipping the first column)
                     cell.prev().click();
                 }
                 else if ( e.shiftKey ) {
                     // Up to the previous row
                     cell.parent().prev().children().last(0).click();
                 }
                 else if ( cell.next().length ) {
                     // One cell to the right
                     cell.next().click();
                 }
                 else {
                     // Down to the next row
                     cell.parent().next().children().eq(1).click();
                 }
             }
        } );
     }
 } )
 .on( 'close', function () {
     $(document).off( 'keydown.editor' );
 } );

$('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this, {
submitOnBlur: true
} );
} );

var table = $('#tabledata').dataTable( {
     dom: "Tfrtip",
    ajax: "viewOrder.do?method=listOfOrders",
    columns: [

        { data: "orderId" },
        { data: "orderType" },
        { data: "original" },
        { data: "creationDate" },
        { data: "receiver_mcSupplierno" },
        { data: "receiver_name" }
    ]
    ,
    tableTools: {
        sRowSelect: "os",

        aButtons: [
            { sExtends: "editor_create", editor: editor },
            { sExtends: "editor_edit",   editor: editor },
            { sExtends: "editor_remove", editor: editor },
            {
                sExtends: 'select_single',
                sButtonClass: 'marginLeft',
                sButtonText: 'Alter salary'
            }
        ]
    }
} );

} );

I have used following JS


Please give me some clues . i am stuck in this ..

ERROR is
" TypeError: this[v2L][l9] is undefined

...1L+M2s+x3L+T5s+p1L)](this[v2L][W1]);var c=this[v2L][l9][a];if(c)return c[(M9+f2L..."

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    In the Editor initialisation:

    type:"data"

    There is no field type called data built into Editor, which is where the error is coming from.

    Do you want a hidden field there? If so use hidden.

    Regards,
    Allan

  • kumar_endeavourkumar_endeavour Posts: 5Questions: 3Answers: 0

    Hello Allan,
    thank you for the reply, i changed the data to "data" in columns, but still the same error.
    I am trying to use this Struts application, with jsp.
    Is editor possible to use in such kind of applications

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Sorry, I should have been more explicit. Here:

                label: "Created:",
                name: "creationDate",
                type:"data"
    

    you are telling Editor to use a field of type data. But there is no such field type (unless you have written a plug-in for it).

    Allan

  • kumar_endeavourkumar_endeavour Posts: 5Questions: 3Answers: 0

    Thank you Alan, this worked for me.
    Just had one more question, how does the buttons (add, edit,delete) determines, which method to call for addition, edit, or delete operation, do we need to specify it separately?

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    The action taken on button click is defined by the button you are using. So for example editor_create will call create() etc.

    Allan

This discussion has been closed.