datable jquery in APSNET CORE 5 - API to open the file??
datable jquery in APSNET CORE 5 - API to open the file??
SBD999
Posts: 36Questions: 1Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Description of problem:
I use datatable in aspnet.core 5. This table is fill with link of the file localised in server sql in table File Table.
The problem is to define the good api.
The configuration datatable :
$(document).ready(function () {
$('#wSerieDatatable').dataTable({
"processing": true,
"serverSide": true,
"filter": true,
"ajax": {
"type": "POST",
"url": "/api/wSerie",
"datatype": "data.json"
},
"columnDefs": [{
"targets": [0],
"visible": true,
"searchable": true
}],
"columns": [
{
"data": "name", "name": "Name", "autoWidth": true,
render: function (data, type, row, meta) {
if (type === 'display') {
data = '<a href="/api/wSerie/path' + row.path+ '" >' + row.name + '</a>';
}
return data
}
},
{ "data": "file_type", "name": "Size", "autoWidth": true}
]
});
});
Error messages shown:
It's clear that my API it's not good!
Do you have an example that uses datable jquery in APSNET CORE 5 and especially with the data stored on a sql server with a file table?
Thanks in advance!
Replies
I assume this happens when you click the link in the
name
cell. Theundefined
is fromrow.path
. This suggests that your row data doesn't have thepath
object resulting in theundefined
. Use the browser's network inspector to see the Ajax response from the server. Does it contain apath
object for each row?Kevin
I resolve my issue by added Sql view. thnaks to your support.