Compatibility with MS Edge

Compatibility with MS Edge

insatriinsatri Posts: 6Questions: 2Answers: 0

Hi There,

I have tried following this example:
https://editor.datatables.net/examples/extensions/keyTable.html

I have made a simple app in Rails 4.2 that lets you edit a list of books. When I try to run this in chrome, firefox and ie 11 everything works ok. When I run it in MS Edge I get strange behaviour as follows:

1) Moving horizontally from column to column within a row editing works correctly.
2) Editing one cell then moving vertically in the same column then I cannot edit another cell and Edge crashes.
3) I have tried the same thing on the above link on the example and I cannot see this problem.

I have used these versions:
Editor 1.5.6
KeyTable 2.1.2
Select 1.2.0
DataTables 1.10.12
tried jQuery 2.2.1 and jQuery 1.12.0 and jQuery 1.12.1

The code I have is as follows:

var editor;

$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
        ajax: "/books/update_book.json",
        table: "#example",
        formOptions: {
            inline: {
                submit: 'allIfChanged'
            }
        },
        fields: [ {
            label: "Author:",
            name: "author"
        }, {
            label: "Title:",
            name: "title"
        }, {
            label: "Description:",
            name: "description"
        }, {
            label: "Number of Pages:",
            name: "number_of_pages"
        }, {
            label: "Isbn:",
            name: "isbn"
        }
        ]
    } );

    var table = $('#example').DataTable( {
        dom: "Bfrtip",
        ajax: "/books/get_books.json",
        columns: [
            { data: "author" },
            { data: "title" },
            { data: "description" },
            { data: "number_of_pages" },
            { data: "isbn" }
        ],
        keys: {
            columns: [0,1,2,3,4],
            editor:  editor
        },
        select: {
            style:    'os',
            selector: 'td:first-child',
            blurable: true
        }
    } );

    editor
        .on( 'open', function ( e, mode, action ) {
            if ( mode === 'main' ) {
                table.keys.disable();
            }
        } )
        .on( 'close', function () {
            table.keys.enable();
        } );
} );

Answers

  • allanallan Posts: 61,864Questions: 1Answers: 10,136 Site admin

    Hi,

    I've just tried to reproduce this in Edge, but wasn't able to I'm afraid. The example link you gave works okay for me.

    Can you give me a link to your page that does show this error so it can be debugged?

    Thanks,
    Allan

  • insatriinsatri Posts: 6Questions: 2Answers: 0

    Hi Allan,

    Thanks for the reply. As you asked I have deployed it on a site here is the link http://bookstore.insatri.com/. I tested it in IE11 and Chrome and it seems to be working when I tried in Edge it does not. It shows some errors in the js console. Just to confirm the behaviour I am getting is as follows:

    1) Moving horizontally from column to column within a row editing works correctly.
    2) Editing one cell then moving vertically in the same column then I cannot edit another cell and Edge crashes.

  • insatriinsatri Posts: 6Questions: 2Answers: 0

    Hi Allan,

    Have you had a chance to look at this. I am not sure where the problem is. Let me know if you need any more info.

  • allanallan Posts: 61,864Questions: 1Answers: 10,136 Site admin

    I've just committed a change into KeyTable that I hope will address this issue. I'm not certain it will as I wasn't able to reproduce the problem with my own examples, while I could clearly see it on your page.

    Could you try the nightly version of KeyTable. it should rebuild with the change in a few minutes.

    Allan

  • insatriinsatri Posts: 6Questions: 2Answers: 0

    Hi Allan,

    Thank for the reply. I have deployed that nightly version and it seems to have more or less the same problem. Where as before it would crash when editing and moving down and editing again, now it does not crash but still won't let you edit. I have put the update onto the bookstore.insatri.com. I am wondering if the rails asset pipeline has anything to do with this.

  • allanallan Posts: 61,864Questions: 1Answers: 10,136 Site admin

    Very odd! I don't have an immediate fix for that I'm afraid. I'll try to debug it and get back to you.

    Allan

This discussion has been closed.