从search.push函数中的数据表中获取“数据排序”正交值 [英] Get 'data-sort' orthogonal value from DataTables within search.push function

查看:77
本文介绍了从search.push函数中的数据表中获取“数据排序”正交值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在循环 $。fn.dataTable.ext.search.push 函数中的行,以根据许多条件选择一些行。我在称为TD 上设置一些值nofollow noreferrer>正交数据。我正在尝试获取 数据排序 的价值,但我不知道该怎么做。我可以通过 data [2] (针对第2列)获取单元格的内部数据,但不能通过数据排序或数据过滤器获取。有什么想法吗?

I am looping the rows within $.fn.dataTable.ext.search.push function to select some rows based on many criteria. I am setting some values on the TD of the tables known as orthogonal data. I am trying to get the value of the 'data-sort' but I don't know how. I am able to get the cell's inner data via data[2] (for column 2), but not the 'data-sort' or 'data-filter'. Any ideas?

$.fn.dataTable.ext.search.push(
    function (settings, data, dataIndex) {

        var iRating = parseFloat(data[2]) || 0; // this works 
        var datasort = //somehow get the data-sort from the TD
);

HTML

<td data-sort="57000" class=" seqNum">.....</td>


推荐答案

就像这样,我可以得到值。如果还有其他更好的方法,请提出建议:

Looks like this way I can get the value. If there are any other better ways please advice:

$(settings.aoData[dataIndex].anCells[2]).data('sort')

这篇关于从search.push函数中的数据表中获取“数据排序”正交值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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