Inline tab issues - options

Inline tab issues - options

alord84alord84 Posts: 24Questions: 15Answers: 1
edited August 2015 in Editor

When I use info: false for inline tab - I can't tab between columns and I can only edit one cell for the table before it's uneditable. Any suggestions?

http://debug.datatables.net/emihex

var editor; // use a global for the submit and return data rendering in the examples

$(document).ready(function() {
    editor = new $.fn.dataTable.Editor( {
        ajax: "../php/staff.php?userid=1",
        table: "#example",
        fields: [ {
                label: "First name:",
                name: "first_name"
            }, {
                label: "Last name:",
                name: "last_name"
            }, {
                label: "Position:",
                name: "position"
            }, {
                label: "Office:",
                name: "office"
            }, {
                label: "Extension:",
                name: "extn"
            }, {
                label: "Start date:",
                name: "start_date",
                type: "date"
            }, {
                label: "Salary:",
                name: "salary"
            }
        ]
    } );

    var table = $('#example').DataTable( {
        dom: "Bfrtip",
        info: false,
        ajax: "../php/staff.php?userid=1",
        columns: [
            {
                data: null,
                defaultContent: '',
                className: 'select-checkbox',
                orderable: false
            },
            { data: "first_name" },
            { data: "last_name" },
            { data: "position" },
            { data: "office" },
            { data: "start_date" },
            { data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
        ],
        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 }
        ]
    } );

    table.on( 'key-focus', function ( e, datatable, cell ) {
        editor.inline( cell.index(), {
            onBlur: 'submit'
        } );
    } );
} );

Answers

  • allanallan Posts: 61,823Questions: 1Answers: 10,129 Site admin

    Can you link to the page show I can debug the issue please? Are you seeing any errors in the console?

    Allan

  • alord84alord84 Posts: 24Questions: 15Answers: 1

    http://debug.datatables.net/emihex

        <script type="text/javascript" language="javascript" class="init">
    
    
    
    var editor; // use a global for the submit and return data rendering in the examples
    
    $(document).ready(function() {
        editor = new $.fn.dataTable.Editor( {
            ajax: "../php/staff.php",
            table: "#example",
            fields: [ {
                    label: "First name:",
                    name: "first_name"
                }, {
                    label: "Last name:",
                    name: "last_name"
                }, {
                    label: "Position:",
                    name: "position"
                }, {
                    label: "Office:",
                    name: "office"
                }, {
                    label: "Extension:",
                    name: "extn"
                }, {
                    label: "Start date:",
                    name: "start_date",
                    type: "date"
                }, {
                    label: "Salary:",
                    name: "salary"
                }
            ]
        } );
    
        var table = $('#example').DataTable( {
            dom: "Bfrtip",
            info: false,
            ajax: "../php/staff.php",
            columns: [
                {
                    data: null,
                    defaultContent: '',
                    className: 'select-checkbox',
                    orderable: false
                },
                { data: "first_name" },
                { data: "last_name" },
                { data: "position" },
                { data: "office" },
                { data: "start_date" },
                { data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
            ],
            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 }
            ]
        } );
    
        table.on( 'key-focus', function ( e, datatable, cell ) {
            editor.inline( cell.index(), {
                onBlur: 'submit'
            } );
        } );
    } );
    
    
    
        </script>
    
This discussion has been closed.