我需要从recordId中设置默认页面。在查看:https://datatables.net/reference/option/rowId之后,我在我的表上设置了一个rowsIds:
$('#logosTable').DataTable(
{
serverSide: true,
processing: true,
searching: true,
autoWidth: true,
responsive: true,
dom: 'rtip',
ajax: {
url: '/Administracion/App/ObtenerListadoLogos',
type: "POST",
data:
function (d) {
d.DefaultLogo = $("#IdLogo").val()
}
},
rowId: 'Id',
columns: [
{ data: 'Id' },
{
data: 'Logo',
searchable: false,
orderable: false,
render: function (data, type, row) {
return '<img src="/DataBackend/ThumbnailsGallery/1/' + data + '" style="width:50px" />';
}
},
{
data: 'acciones',
searchable: false,
orderable: false,
render: function (data, type, row) {
return '<a href="#" onclick="seleccionarLogo(' + row.Id + ', \'' + row.Fichero + '\')"><i class="fa fa-check"></i> Seleccionar </a>';
}
}
]
});如何从记录id设置默认init页?
我已经尝试过这样的方法: 1.10上的https://datatables.net/plug-ins/api/fnDisplayRow Howver,它似乎不再可用了。我看了一下:https://datatables.net/reference/api/,但是这个功能(和fngetNodes)似乎已经消失了。
发布于 2016-12-16 14:13:07
fnDisplayRow是一个插件,您需要将它与主DataTables库分开包含:
https://cdn.datatables.net/plug-ins/1.10.13/api/fnDisplayRow.js
有一个在fnDisplayRow 文件页上使用1.10的示例
// Display the nth row in the table
var table = $('#example').dataTable();
table.fnDisplayRow( table.fnGetNodes()[n] );https://stackoverflow.com/questions/41149105
复制相似问题