Allow open details only on normal rows

Detail rows don't have their own details, so don't allow the click event

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2023-11-15 17:18:10 -03:00
parent 5cd1b2e16b
commit abfa0a44ae
+4 -4
View File
@@ -603,8 +603,8 @@ $(function () {
event.stopPropagation();
});
// Add event listener for opening and closing details
$("#all-queries tbody").on("click", "tr", function () {
// Add event listener for opening and closing details, except on rows with "details-row" class
$("#all-queries tbody").on("click", "tr:not(.details-row)", function () {
var tr = $(this);
var row = table.row(tr);
@@ -618,8 +618,8 @@ $(function () {
row.child.hide();
tr.removeClass("shown");
} else {
// Open this row
row.child(formatInfo(row.data())).show();
// Open this row. Add a class to the row
row.child(formatInfo(row.data()), "details-row").show();
tr.addClass("shown");
}
});