Antrium A35D

Bir sonraki için en iyisini yap...

Cannot read properties of undefined (reading 'mData')

Bu hata çıldırttı beni çıldırttı;

Table stün tanımlama lazım. tam bir bela. Neyse aşağıdaki kod ile çözebilirsiniz.

 

 <table id="datatable" class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;">
     <thead>
         <tr>
             <th>Blok</th>
             <th>Kat</th>                              
         </tr>
     </thead>
     <tbody>
         @foreach (daireler_ item in Model.drl_)
         {
             <tr>
                 <td>@Html.Raw(item.blok)</td>
                 <td>@Html.Raw(item.kat)</td>                                  
             </tr>
         }
     </tbody>
 </table>

 

Script;
 

<script>
    $(document).ready(function () {

        $('#datatable').DataTable({

            "language": { url: '/modul/datatable_tr.json' },
            columns: [
                { type: 'string' },
                { type: 'num' },

            ]
        });

    });
</script>

139 Okunma | 19.10.2023 17:35

YORUMLAR

Yorum Yaz
Hüseyin ÖZKAN Yazılım Uzmanı

C#,MVC,MSSQL,Windows Forms