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

后端 未结 1 1036
天涯浪人
天涯浪人 2020-12-10 12:41

How to add multiple json values in a single cell of dataTable. I am going through the datatables documentation but cant get a clear example.

I have the following JSO

相关标签:
1条回答
  • 2020-12-10 13:10

    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>"}
    ]
    
    0 讨论(0)
提交回复
热议问题