jquery - aoColumnDefs vs fnRowCallback which is better and faster -


i have use case want render anchor link on specific column index. can achieved using both fnrowcallback , aocolumndefs.

so wondering 1 better , faster.

code snippets both cases :

aocolumndefs

 "aocolumndefs": [  {     "fnrender": function ( oobj ) {      return '<a href="abc.html">' + oobj.adata[8]+ '</a>';      },     "atargets": [8] }, ] 

fnrowcallback

"fnrowcallback" : function( nrow, adata, idisplayindex, idisplayindexfull ) {  $("td:eq(8)", nrow).html('<a  href="abc.html">' + adata[8]+ '</a>' );} 

i believe newest builds of datatables fnrender deprecated , should using mdata , mrender

mrender preferred use on fnrowcallback on server-side implementations create urls data

here example, add aocolumns field, , remove fnrowcallback

  { "mdata": null ,      "mrender" : function ( data, type, full ) {     return '<a href="abc.html">'+full[8]+'</a>';}   }, 

docs: http://www.datatables.net/release-datatables/examples/advanced_init/column_render.html


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -