How to add multiple json values in a single cell of dataTable

眉间皱痕 提交于 2019-11-28 10:55:18

Prior to DataTables 1.10.x, you could use the mRender parameter like this:

"aoColumns":[   
   {"mData":"LastName",
    "sClass":"left", 
    "mRender":function(data, type, full){
       return full.FirstName + full.LastName + full.MiddleInitial;
    }
   },
   {"mData":"ServiceDate","sClass":"left"},
   {"mData":"ChargeAndDx","sClass":"left"},
   {"mData":"BillingProvider","sClass":"left"},
   {"mData":"null","sClass":"center","sDefaultContent":"<a href='' class='editor_menu'>menu</a>"}
]

Starting from DataTables 1.10.x, you could use the columns.render property like this:

"columns":[   
   {"data":"LastName",
    "className":"left",
    "render":function(data, type, full, meta){
       return full.FirstName + full.LastName + full.MiddleInitial;
    }
   },
   {"data":"ServiceDate","sClass":"left"},
   {"data":"ChargeAndDx","sClass":"left"},
   {"data":"BillingProvider","className":"left"},
   {"data":"null","className":"center","defaultContent":"<a href='' class='editor_menu'>menu</a>"}
]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!