加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc-4 – 如何在Jquery DataTable中获取隐藏字段的值

发布时间:2020-12-16 06:50:10 所属栏目:asp.Net 来源:网络整理
导读:我的代码如下所示 $("#tblAdminUsers").dataTable({ bProcessing: true,sAjaxSource: '@Url.Action("FetchAdminUsers","Admin")',aoColumns: [ { sTitle: "Id",bSortable: false,"bVisible": false },{ sTitle: "Email",},{ sTitle: "Location",{ sTitle: "S
我的代码如下所示

$("#tblAdminUsers").dataTable({
                bProcessing: true,sAjaxSource: '@Url.Action("FetchAdminUsers","Admin")',aoColumns: [
                     { sTitle: "Id",bSortable: false,"bVisible": false },{ sTitle: "Email",},{ sTitle: "Location",{ sTitle: "Status",bSortable: true,{ sTitle: "UserType",{
                         sTitle: "Actions",mRender: function (nRow,aData,iDisplayIndex) { return '<i class="ui-tooltip fa fa-pencil actions clsEdit" style="font-size: 22px;" data-original-title="Edit" ></i> <i class="ui-tooltip fa fa-trash-o actions clsDelete" style="font-size: 22px;" data-original-title="Delete"></i>'; }
                     }
                ]

             });

我的问题是,如何在编辑或删除按钮单击时获取隐藏字段的值(此处为Id)

解决方法

使用数据表1.10:

var row_that_you_want = 1 //you need to determine this how ever you like
 var table = $('#tblAdminUsers').DataTable()
 var column_data = table.row(row_that_you_want).data()[0]

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读