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?

timothy.ctr.searcy@faa.govtimothy.ctr.searcy@faa.gov Posts: 3Questions: 2Answers: 0
edited June 19 in Editor

Hi,

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) {
            
            console.table(editor.modifier());

            /* Is there any api like below code?
            //console.log(editor.modifier().fieldName());
            //console.log(editor.modifier().column());
             */
            
        });

Answers

  • colincolin Posts: 5,590Questions: 0Answers: 976

    Hi @timothy.ctr.searcy@faa.gov ,

    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,

    Cheers,

    Colin

Sign In or Register to comment.