0
我有一个作为Jquery数据表运行的表。我有以下要求Jquery Datatables OnSort更新列与来自另一列的图
当一列用户各种各样然后
- 我需要indentify列
- 根据这个排序列,我想从另一列是不可见的价值用户
- 使用此值我想更新表中的第一列。这是一个可见列
我已绑定某种事件与一个叫eventFired按照例子功能表上 http://datatables.net/release-datatables/examples/advanced_init/dt_events.html
最好的,我能得到自己低于
function eventFired(type) {
var oTable = $('#tabOverlayLeagueTable').dataTable(); //select table
var oSettings = oTable.fnSettings(); //get settings
var sortByindex = oSettings.aaSorting[0][0];//get index of sort column
//var nNodes = oTable.fnGetNodes(); // I am not sure if I should use this
var data = oTable.fnGetData(); // I get the data from this call
// loop then data rows
for (var i = 0; i < data.length; i++) {
// update the first column in the table
// with a specific column (this is a hidden column). In
//example its cashiers rank figure
oTable.fnUpdate(data[i].CashierRank, i, 0);
}
}
问题
- 这可能不是解决我的问题的最佳方法
- 我想通过索引而不是名称得到列
data[i].CashierRank
- 该代码不起作用。似乎永远循环!