I would like to click the row in tablelist and be taken to the row view. I had a code from previous versions but it is not working here in the latest v2020.0.7table name is My_Artfield1 = Art_id
field2 = Image
field3 = Title
field4 = Artist
field5 = Category
etc…Any help will be appreciated, thanks.
napiedra wrote:
I had a code from previous versionsCan you post your code for discussion?
Here is the code:<?php if (Security()->canView()) { // don't forget this for security ?>
$(document).ready(function() {
$(‘#tbl_My_Artlist tr’).click(function() { // click event for table id and row selector; adjust it to your table id!
var view_page = $(this).find(“a.ew-row-link.ew-view”).attr(“href”); // get the href
window.location.href = view_page; // open the view page
});
});
Simply change your code to:<?php if (Security()->canView()) { // don't forget this for security ?>
$(‘#tbl_My_Artlist tr’).click(function() { // click event for table id and row selector; adjust it to your table id!
var view_page = $(this).find(“a.ew-row-link.ew-view”).attr(“href”); // get the href
window.location.href = view_page; // open the view page
});
This code still does not work. Do I need to edit the “href” too?
Actually it matches my table name now but it won’t work with single or double click on the record. It does not look like it is a link (shows the little hand).
napiedra wrote:
var view_page = $(this).find(“a.ew-row-link.ew-view”).attr(“href”); // get the> hrefYou better press F12 in your browser and check the HTML of the link, sometimes it is not a simple href, depending on your field settings in the project.