我试图在我的 View 中隐藏 ID th,我使用 jquery 数据表,有没有隐藏它?我不想在我的前端我的 html 和 JS 中看到它,如下所示。
HTML:
<thead>
<tr>
<th>Status</th>
<th>ID</th>
<th>Upload Date</th>
<th>File Name</th>
<th>Bank</th>
<th>Upload By</th>
<th>filepath</th>
<th>summarypath</th>
<th>ACTION</th>
</tr>
</thead>
JS:
"aoColumns": [
{ "sName": "FileStatus", "sClass": "left", "sWidth": "100px" },
{ "sName": "ID", "sClass": "left", "sWidth": "200px" },
{ "sName": "Crdt", "sClass": "left", "sWidth": "100px", "sType": "date" },
{ "sName": "FileName", "sClass": "left" },
{ "sName": "BankName", "sClass": "left", "sWidth": "100px" },
{ "sName": "Crid", "sClass": "left", "sWidth": "150px" },
{ "sName": "filepath", "sClass": "left", "sWidth": "10px", "bVisible": false },
{ "sName": "summarypath", "sClass": "left", "sWidth": "10px", "bVisible": false },
{ "sName": "", "sWidth": "100px", "bSearchable": false, "bSortable": false, "fnRender": function (oObj)
最佳答案
根据documentation ,你可以试试:
"aoColumns": [
{ "sName": "FileStatus", "sClass": "left", "sWidth": "100px" },
{ "sName": "ID", "bVisible": false },
{ "sName": "Crdt", "sClass": "left", "sWidth": "100px", "sType": "date" },
// Following the code
关于javascript - 在 html 和 jquery 中隐藏第 th 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32379526/