gpt4 book ai didi

javascript - 如何合并数据表字段?

转载 作者:行者123 更新时间:2023-11-29 21:06:12 25 4
gpt4 key购买 nike

数据库表字段:id,first_name,last_name,email

数据表:全名,电子邮件(无 ID)?

 <script type="text/javascript">
$(document).ready(function () {


var table = $('#havuz_table').DataTable({

"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],

"ajax": "{{URL::to('ajaxUzmanListesi/')}}",
"language": {
"url": '/lib/datatables/language/Turkish.json'
},
"columns": [
{
"mData": null ,
"mRender" : function ( data, type, full ) {
return full['first_name']+''+full['last_name'];}
}

]

});

});

最佳答案

试试这个:

"columns": [{
"data": null,
"title": "Name",
"render": function(data, type, full) {
return full['first_name'] + ' ' + full['last_name'];
}
},
{
"data": "email",
"title": "Email"
}
]

工作 JSFiddle here .希望对您有所帮助。

关于javascript - 如何合并数据表字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43932497/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com