Event after entering inline edit mode

Event after entering inline edit mode

elicymelicym Posts: 8Questions: 3Answers: 0

I have a JQuery plugin called NumberInput that you call on an input element and it allows only numbers to be entered. I would like to apply it to a field in inline edit mode. I noticed that the following events get fired when entering inline edit mode, but none of them are suitable for applying my plugin:

  • inlineEdit & inlineMultiEdit - the input element doesn't exist yet
  • preOpen & open - the parameters supplied contain no information, so I can't locate the field

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    I would use field().input() to get the input element directly. You don't need to wait for the editing view to be opened - e.g.:

    var editor = new $.fn.dataTable.Editor( ... );
    
    $( editor.field('myNumberField').input() ).jQueryNumberPlugin();
    

    Allan

  • elicymelicym Posts: 8Questions: 3Answers: 0

    Thank you.
    I didn't realize that the same HTML element is reused for all rows, in inline mode.

This discussion has been closed.