How to get the value of a hidden field in Jquery DataTable

偶尔善良 提交于 2019-12-23 15:17:10

问题


My code is listed below

$("#tblAdminUsers").dataTable({
                bProcessing: true,
                sAjaxSource: '@Url.Action("FetchAdminUsers", "Admin")',
                aoColumns: [
                     { sTitle: "Id", bSortable: false, "bVisible": false },
                     { sTitle: "Email", bSortable: false, },
                     { sTitle: "Location", bSortable: false, },
                      { sTitle: "Status", bSortable: true, },
                       { sTitle: "UserType", bSortable: false, },

                     {
                         sTitle: "Actions",
                         bSortable: false,
                         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>'; }
                     }
                ]

             });

my problem is, how to get the value of the hidden field(here it is Id) on edit or delete button click


回答1:


Using datatables 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]


来源:https://stackoverflow.com/questions/24141128/how-to-get-the-value-of-a-hidden-field-in-jquery-datatable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!