0
我對我的表有以下代碼class="table table-striped table-bordered bootstrap-datatable datatable datatable"
我想使用像搜索,分頁等數據表功能。因此,我在類列表中添加了數據表。未捕獲TypeError:無法讀取未定義的屬性'className'數據表
我還包括一個鏈接到<script src='js/jquery.dataTables.min.js'></script>
但我得到這個錯誤。哪個類名缺少如何添加? Uncaught TypeError: Cannot read property 'className' of undefined and it points
轉換爲.js文件中的此行。
(n.className+=" "+m.sClass),k?d._anHidden[g]=null:(d._anHidden[g]=n,n.parentNode.removeChild(n)),m.fnCreatedCell&&m.fnCreatedCell.call(a.oInstance,n,w(a,b,g,"display"),d._aData,b,g)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)d=a.aoData[b],C(a,"aoRowCreatedCallback",null,[d.nTr,d._aData,b])}}function K(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function da(a,b,c){for(var b=L(a,b),d=0,a=a.aoColumns.length;d<a;d++)if(b[d]===c)return d;
目前這是我的表結構看起來像
<div class="box-content">
<table class="table table-striped table-bordered bootstrap-datatable datatable datatable" style='table-layout: fixed;'>
<thead>
<tr>
<th style='width: 10%;'>No.</th>
<th style='width: 35%;'>Name</th>
<th style='width: 25%;'>Contact Number</th>
<th style='width: 20%;'>Stats</th>
</tr>
</thead>
在執行這個腳本之前我沒有得到你的類名?是的,它的廣告底部的網頁到最後是我稱之爲的地方。 – user5313398
你可以用你的html中的表格結構來更新你的問題,以及你如何執行javascript for datatable? –
嗨,我已經更新我的問題,在我的HTML表結構。它是否正確? – user5313398