Usefulness of `function(e)` when activating inline edit on table cell

Usefulness of `function(e)` when activating inline edit on table cell

rdmrdm Posts: 166Questions: 43Answers: 3

I've been using this snippet since day one to enable inline table editing. Clearly it works, but ReSharper keeps suggesting I remove the "unused" parameter e. I'm just curious if there any undocumented uses of that parameter that could be useful for enhancing the below function.

            // Activate an inline edit on click of a table cell
            $('#example').on( 'click', 'tbody td:not(:first-child)', function (e) {

This question has an accepted answers - jump to answer


  • colincolin Posts: 3,382Questions: 0Answers: 602

    Hi @rdm ,

    It can sometimes, it can contain data specific for that event, see the example here where the click event behaviour is modified. It can be used when editing cells, see this example here, but yep, I think ReSharper is correct in your case,



  • allanallan Posts: 48,700Questions: 1Answers: 7,082 Site admin
    Answer ✓

    Just to extent upon that, ReSharper is correct - you aren't using e anywhere in your function and Editor doesn't depend on you passing the event in (thus it can't access it), so you don't need it. It can be safely dropped.


Sign In or Register to comment.