For those of you who have been implementing this code for v2019, then here is the code for v2022:
<?php if (Security()->canView()) { // don't forget this for security ?>
$('#tbl_modelslist tr').click(function() { // click event for table id and row selector; adjust it to your table id!
var view_modal = $(this).find("a.ew-row-link.ew-view").attr("data-url"); // get the url
ew.modalDialogShow({lnk:this, url: view_modal}); // display the View Page in modal dialog
});
<?php } ?>
This code is much simpler than for v2019, since we can get the URL from data-url
attribute that belongs to the a href link.