Cursor not moving on after editing & tabbing to next column

Cursor not moving on after editing & tabbing to next column

FredTheEarwigFredTheEarwig Posts: 3Questions: 1Answers: 1

Hi,
I am finding that when clicking on a cell altering its contents & then tabbing to the next cell that although the border of the next cell changes colour the cursor remains in the previous one. I tried putting adding submission on blur but this had no effect. Am I missing something obvious in my set up?

Current editor & table implementations:

editor = new $.fn.dataTable.Editor({
data: data,
table: "#mileageTable",
idSrc: "EditingGridlineRowId",
keys: true,
fields: [
{ name: "car" },
{ name: "person" },
{ name: "mileage" }
],
});

        var table = $('#mileageTable').DataTable({
             "language": {
                "zeroRecords": "No records to display"
            },
            fixedColumns: true,
            responsive: true,
            dom: 'Bfrtip',
            ordering: false,
            searching: false,
            paging: false,
            info: false,
            data: mileageRecords,
            columns: [
                {
                    data: "car",
                    className: "centreColumn"
                },
                {
                    data: "person"
                },
                {
                    data: "mileage",
                    width: "20px",
                    className: "centreColumn"
                }
            ],
            rowId: "recordId",
            keys: {
                columns: ':not(.disableEditing, :first-child)',
                editor: editor,
                editOnFocus: true
            },
            autoFill: {
                columns:  ':not(.disableEditing, :first-child)',
                editor: editor
            }
        }); // end table

        $('#mileageTable').on('click', 'tbody td:not(.disableEditing, :first-child)', function (e) {    
            editor.inline(this);
                //editor.inline(this, {
                //    onBlur: "submit"
                //}); (this did not help with the cursor moving on issue)
        });

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    I don't see anything obvious there. Could you give me a link to the page please?

    Allan

  • FredTheEarwigFredTheEarwig Posts: 3Questions: 1Answers: 1

    Unfortunately it is on an intranet so no. I have set up a copy of the page (cut down obviously) on Codepen link https://codepen.io/FredTheEarwig/pen/vVRJVN.

    Interestingly I notice that if you click on a cell edit it & then tab it does as described. When you start typing in the cell you have typed to it moves the cursor. From that point on tabing through the cells moves the cursor until you click directly on a cell, at which point the cursor seems to stay put again at first. Also I have just noticed that the autofill seems a bit temperamental in that it only seems to work after 2 or even 3 attempts.

    Be grateful for any suggestions. Cheers :smile:

  • FredTheEarwigFredTheEarwig Posts: 3Questions: 1Answers: 1
    Answer ✓

    This has now been solved the event needed to be set on the editor rather than that table itself.

This discussion has been closed.