2017-02-08 16 views
0

私はdatatablesで別の列からプロパティにアクセスしたいと思います。例えばDatatables ColumnDefs異なる列のデータにアクセスしますか?

columnDefs: [ 
      { 
       "targets": 4, 
       "data": "default_price_with_discount", 
       "sClass": "text-center", 
       "render": function (data, type, full, meta) { 
        return '<strong>' + data + '</strong>'; 
       } 
      }, 
      { 
       "targets": 5, 
       "data": "default_bonus", 
       "sClass": "text-center", 
       "render": function (data, type, full, meta) { 

        // how can i acccess here column 4? 

        return '<strong>' + data + '</strong>'; 

       } 
      }, 

例えば、カラム5から4列目にアクセスする方法任意のアイデアは?

答えて

0

"full"には、rowのすべての列値が含まれます。例えば、

{ 
"targets": 5, 
"data": "default_bonus", 
"sClass": "text-center", 
"render": function (data, type, full, meta) { 
var column4Value = full.default_price_with_discount; 
return '<strong>' + data + '</strong>'; 
} 
}, 
関連する問題