
I am using exactly this example : http://datatables.net/release-datatables/examples/server_side/server_side.html
Now I don't want to have 3 columns "Artits, Title, Version" instead I want to have one column "Name" where the 3 are shown together.
I have no idea how to do this...
Also I wanted to add a hyperlink to the "Name" that contains the "setid" but this code is not so easy to understand for me.
This here is not working :
var oTable = $('#example').dataTable({
"bServerSide": true,
"sAjaxSource": "serversideTests.php",
"sAjaxDataProp": "aaData",
"bProcessing": true,
"aoColumns": [{
"mData": "setid"
}, {
"mData": "beatmapid",
"sClass": "hidden"
}, {
"mData": "expectedPP"
}, {
"mData": "perfectPP"
}, {
"mData": "Artist",
"sClass": "hidden"
}, {
"mData": "Title",
"sClass": "hidden"
}, {
"mData": "Version",
"sClass": "hidden"
}, {
"mData": null,
"mRender": function(data, type, full) {
return full['Artist'] + '-' +
full['Title'] + '[' + full['Version'] + ']' +
'<br><a href=/' + 'osu.ppy.sh/d/' + full['setid'] + '>' + 'Download' + '</a>';
}
}, {
"mData": "StarDifficulty"
}, {
"mData": "ApproachRate"
}, {
"mData": "BPM"
}, {
"mData": "length"
}]
});
With indexes
var oTable = $('#example').dataTable({
"bServerSide": true,
"sAjaxSource": "serversideTests.php",
"sAjaxDataProp": "aaData",
"bProcessing": true,
"aoColumns": [{
"mData": [0],
"sClass" : "hidden"
}, {
"mData": [1]
}, {
"mData": [2]
}, {
"mData": [3]
}, {
"mData": [4],
"sClass": "hidden"
}, {
"mData": [5],
"sClass": "hidden"
}, {
"mData": [6],
"sClass": "hidden"
}, {
"mData": null,
"mRender": function(data, type, full) {
return full[4] + '-' +
full[5] + '[' + full[6] + ']' +
'<br><a href=/' + 'osu.ppy.sh/d/' + full[1] + '>' + 'Download' + '</a>';
}
}, {
"mData": [7]
}, {
"mData": [8]
}, {
"mData": [9]
}, {
"mData": [10]
}, {
"mData": [11]
}]
});