Editor DIsable refresh after update

Editor DIsable refresh after update

autumndevautumndev Posts: 8Questions: 3Answers: 0

Hi, Im using edirot with Datables with server side data and processing and inline editing (submit full row). I note that on row update the whole table is refreshed - can this be stopped?

there is no point updating the one row and then getting 100's or rows worth of data again.

My code is as follows:

$('#pricingTable').on( 'click', 'tbody td.editable', function (e) {
        editor.inline( this, {
            onBlur: 'submit',
            submit: 'allIfChanged'
        });
    } );

    var pricingTable = $('#pricingTable').DataTable( {
        ajax: '/api/datatables/pricing',
        processing: true,
        serverSide: true,
        sServerMethod: 'POST',
        dom: 'Brtilp',
        fixedColumns: true,
        scrollX: true,
        scrollCollapse: true,
        fixedColumns:   {
            leftColumns: 17
        },
        lengthMenu: [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, "All"]],
        columns: columns,
        columnDefs: [ {
            "targets": 5,
            "data": "displayName",
            "render": function ( data, type, row, meta ) {
                return '<a href="#" class="stockDetails" data-deviceid="'+row.deviceOptionsDeviceId+'" '+
                    'data-capacityid="' + row.deviceOptionsCapacityId + '" ' +
                    'data-colourid="' + row.deviceOptionsColourId + '" ' +
                    'data-gradeid="' + row.deviceOptionsGradeId + '" ' +
                    'data-network="' + row.networkName + '" ' +
                    'data-gradeName="' + row.gradeName + '" ' +
                    'data-colourName="' + row.colourName + '" ' +
                    'data-capacityName="' + row.capacityName + '" ' +
                    'data-deviceName="' + row.deviceName + '" ' +
                    '>'+data+'</a>';
            }
        } ],
        searchCols: [
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            { "search": 'unlocked' } 
        ],
        select: {
            style:    'os',
            selector: 'td:first-child'
        },
        buttons: buttons,
        "fnInitComplete": function(oSettings, json) {
            $( 'select.priceSearch' ).val('Unlocked').change();
        }
    } );

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin
    Answer ✓

    Yes, you can use the drawType option of the formOptions - add drawType: 'none' to the object you pass to inline().

    Its worth noting though that if you do that then the new data will not be sorted or filtered until the next draw, so it can be out of sync with the rest of the table.

    Allan

This discussion has been closed.