How to edit only one row?

How to edit only one row?

AJ31AJ31 Posts: 4Questions: 3Answers: 0
edited February 2023 in Free community support

How can I force edit of only single row, but select multiple row for Exporting to Excel?
I have my DataTable defined as follows:

    var table = $('#example').DataTable({
        dom : "Bfrtlip",
        ajax : './DataServlet,
        lengthMenu : [ [ 10, 25, 50, -1 ], [ 10, 25, 50, "All" ] ],
        select: {
            style:    'multi',
            selector: 'td:first-child'
        },
        order : [ [2, "asc"] ],
        columns : [ {
            data : null,
            defaultContent : '',
            className: 'select-checkbox',
            orderable: false
        }, {
            data : "Id",
            defaultContent : ''
        },{
            data : "FirstName",
            defaultContent : ''
        }, {
            data : "LastName",
            defaultContent : ''
        }, {
            data : "userName",
            defaultContent : ''
        }, {
            data : "updateDate",
            defaultContent : ''
        }] ,
        fixedHeader: true,
        buttons: buttonArray
    });

buttonArray.push(
    {   
        extend: "edit", 
        className: 'btn btn-primary bg-purple text-white',
        editor: editor 
    },
    {
        extend: 'excelHtml5', 
        text: 'EXPORT TO EXCEL', 
        autoFilter: true,
        exportOptions: {
            modifier: {
                selected: true
            },
            columns: 'th:not(:first-child)'
        }
    }

The issue I am currently facing is, if I select multiple rows on a page and then move to a different page the edit button gets enabled automatically.

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I see you're using Editor in your example, but our accounts aren't showing that you have a license. Is the license registered to another email address? Please can let us know so we can update our records and provide support.

    Thanks,

    Colin

Sign In or Register to comment.