2016-12-14 100 views
0

我需要從recordId設置默認頁面。 後採取了看看:https://datatables.net/reference/option/rowId 我已在我的表中的rowsIds:Jquery Datatables:從rowId設置頁面

$('#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設置默認初始化頁?

我試過這個:https://datatables.net/plug-ins/api/fnDisplayRow 無論在1.10上,它似乎不再可用。 我看看:https://datatables.net/reference/api/ 但似乎這個功能(和fngetNodes)已經消失。

+1

'fnDisplayRow'是一個需要單獨包含的插件,並且在'fnDisplayRow'文檔頁面上有一個使用'fnGetNodes()'爲1.10的例子。 –

+0

@ J.Titus我會接受它作爲接受的ansewer,如果你寫它 – Rumpelstinsk

+0

添加爲答案。謝謝。 –

回答