Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82121

Using Same mData Multiple Times with fnRender

$
0
0
Version: DataTables 1.9.4

I want to use same "oObj.aData.id_company" in multiple columns but it can't render it. It's all OK if I use it only one time as in second code block below:

var col_def = [
  { "mData": "id_company", "sTitle":"Edit","fnRender" : function (oObj){
      return '<a href="'+BaseURL+oObj.aData.id_company+'">Edit</a>';
      }
  },
  { "mData": "company_name", "sTitle":"Company Name", "sWidth":"50%"},
  { "mData": "id_company", "sTitle":"Delete","fnRender" : function (oObj){
      return '<a href="'+BaseURL+oObj.aData.id_company+'">Delete</a>';
      }
  }
];

var col_def = [
  { "mData": "company_name", "sTitle":"Company Name", "sWidth":"50%"},
  { "mData": "id_company", "sTitle":"Delete","fnRender" : function (oObj){
      return '<a href="'+BaseURL+oObj.aData.id_company+'">Delete</a>';
      }
  }
];

I am doing wrong or missing something?

Here is the code for debug: http://debug.datatables.net/unocid

Viewing all articles
Browse latest Browse all 82121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>