I have the following:
$('#applicationsGrid tbody').on('click', 'td.details-control', function () {
var formattedData = dosomething();
$(this).parent('tr').after(formattedData);
});
$('#applicationsGrid tbody').on('click', 'td.child-details-control', function () {
var formattedData = dosomething();
$(this).parent('tr').after(formattedData);
});
$('#applicationsGrid tbody').on('click', 'td.grand-child-details-control', function () {
var formattedData = dosomething();
$(this).parent('tr').after(formattedData);
});
How can I combine all the "on" events into one click event that would take care of clicking on 'td.details-control', 'td.child-details-control', 'td.grand-child-details-control', so I can reduce duplicate code?