Usefulness of `function(e)` when activating inline edit on table cell
Usefulness of `function(e)` when activating inline edit on table cell
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) {
editor.inline(this);
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
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,
Cheers,
Colin
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.Allan