Jquery 数据表 - 使整行成为链接 [英] Jquery Datatables - Make whole row a link
问题描述
这可能很简单,但似乎无法弄清楚.使用 jquery 数据表如何使每一行可点击以链接到普通页面?因此,如果有人将鼠标悬停在任何一行上,整行将突出显示并可点击并链接到我希望它在点击时链接到的任何 url.
This maybe simple, but cant seem to figure it out. Using jquery datatables how can I make each row clickable to just link to a normal page? So if someone moused over any of the row the whole row will hightlight and be clickable and link to whatever url I would want it to link to when clicked.
推荐答案
使用普通的 It's simple enough to do this with a vanilla 您可能还需要一些 You'll probably want some 这篇关于Jquery 数据表 - 使整行成为链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! 很简单,但我不明白为什么这不起作用使用 jQuery DataTables 之一.
<table>
, but I don't see why this wouldn't work with a jQuery DataTables one either.$('#myTableId').on('click', 'tbody > tr > td', function ()
{
// 'this' refers to the current <td>, if you need information out of it
window.open('http://example.com');
});
hover
事件处理,以便在用户单击一行之前向用户提供视觉反馈.hover
event handling there as well, to give users visual feedback before they click a row.
登录
关闭