如何防止数据表中特定列的行单击功能? [英] How to prevent row click function on specific column in datatable?

查看:55
本文介绍了如何防止数据表中特定列的行单击功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理带有可点击行的javascript数据表。每一行都有onclick函数,但是在我的一列中我有不同的链接打开jquery对话框,在这列上我要禁用行点击方法,怎么做?
这里是我实现行点击的功能

I am dealing with a javascript datatable with clickable rows. Each row have onclick function, but in my one column i have different links that open jquery dialogues box, on this column i want to disable row click method, how to do this ? here is function that i implement of row click

$(rec' tbody').on( 'click', 'tr', function () {

});


推荐答案

您必须禁用该特定列的行单击

you have to disable row click for that particular column

$('rec' tbody'').on('click', 'td', function () {

         if ($(this).index() == 4 ) { // provide index of your column in which you prevent row click here is column of 4 index
             return;
         }

            // you can do additional functionality by clicking on this column here                         
    });

这篇关于如何防止数据表中特定列的行单击功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆