How to know the field name of the column on which the inline edit has been triggered?

How to know the field name of the column on which the inline edit has been triggered? Posts: 6Questions: 4Answers: 0
edited June 2019 in Editor


I understand that I can edit only one field in an inline edit call. On the presubmit event, I am wanting to know which column, or field is being updated. I am trying to use modifier() but it gives me the complete object. I want to know how to derive the field name from it.

Some excerpts from my code:

$('#dataTable').on('click', 'tbody td.editable', function (e) {
            editor.inline(this, {
                submit: 'allIfChanged'
        editor.on('preSubmit', function (e, o, action) {

            /* Is there any api like below code?

This question has an accepted answers - jump to answer


  • colincolin Posts: 8,139Questions: 0Answers: 1,362

    Hi ,

    You can get the row that's being edited with ids(), but not the specific cell. There are two ways you could go though. You could either get the cell with the class DTE_Inline, or, you could make a note of the cell being edited in a variable in your click event, then reference that later in the preSubmit event.

    Not ideal, but hopefully they'll do the trick,



  • stolstol Posts: 16Questions: 2Answers: 1

    I have inline editing on a few columns, but I want a confirm box for only one of them.
    This is what I did based on colins idea:
    In the click event that activated the inline editing:

    var row = $(this).closest('tr');
                    var rowData = table.row(row).data();
                    rowId = rowData['DT_RowId'];
                    editor.inline( this, {
                        onBlur: 'submit'
                    } );

    Then in the presubmit function:

    editor.on('preSubmit', function (e, data, action) {
                    if (action == 'edit') {
                        var submitteddata =[rowId];
                        var colname = '';
                        $.each(submitteddata, function (key, value) {
                            colname = key;
                        // console.log(colname);
                        if (colname == 'topicid') {
                            if(!confirm('Are you sure you want to change the topic?')) {
                                return false;
                        else return true;
  • allanallan Posts: 51,453Questions: 1Answers: 7,759 Site admin
    Answer ✓

    displayed is the magic function you want here. It will give a list of the field names which are currently shown by the editing instance. In the case of inline editing, that's just the single one that is editable.


Sign In or Register to comment.