我在Footable版本3(用于Bootstrap)中遇到了一个问题,这个问题在版本2中没有出现。按钮元素短暂地出现,然后完全消失(在HTML中,只剩下按钮的文本-标签被删除了!)。有没有办法绕过这个问题(潜在的bug)?文档中没有提到这一点。
<table class="table table-striped toggle-arrow-alt">
<thead>
<tr>
<th>This</th>
<th>Is</th>
<th>A</th>
<th>TEST</th>
<th data-breakpoints="xs sm">Of</th>
<th data-breakpoints="xs sm">the emergency webcast system</th>
</tr>
</thead>
<tbody>
<tr>
<td>Hi There!</td>
<td>
<button>?</button></td>
<td>foo bugs are not cool</td>
<td>$123,847.88</td>
<td>Hi There!</td>
<td>
<button>?</button></td>
</tr>
<tr>
<td>Hi There!</td>
<td>
<button>?</button></td>
<td>foo bugs are not cool</td>
<td>$99,847.88</td>
<td>Hi There!</td>
<td>
<button>?</button></td>
</tr>
<tr>
<td>Hi There!</td>
<td>
<button>?</button></td>
<td>foo bugs are not cool</td>
<td>$153,847.88</td>
<td>Hi There!</td>
<td>
<button>?</button></td>
</tr>
</tbody>
</table>和标题(也许脚本顺序是错误的-尽管它会调整大小)
<head runat="server">
<title></title>
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<link href="Scripts/FooTable-3/bootstrap/css/footable.bootstrap.min.css" rel="stylesheet" />
<script src="Scripts/jquery-3.1.1.min.js"></script>
<script src="Scripts/bootstrap.min.js"></script>
<script src="Scripts/FooTable-3/bootstrap/js/footable.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".table").footable({
"paging": { "enabled": true },
"sorting": { "enabled": true }
});
});
</script>
</head>当我在Chrome中查看HTML格式的源代码时(请注意,按钮元素完全缺失):
<tr><td class="footable-first-visible" style="display: table-cell;">Hi There!</td><td style="display: table-cell;">
?</td><td style="display: table-cell;">foo bugs are not cool</td><td style="display: table-cell;">$123,847.88</td><td style="display: table-cell;">Hi There!</td><td class="footable-last-visible" style="display: table-cell;">
?</td></tr>不管怎样-想要解决这个问题让我抓狂
发布于 2017-01-09 08:50:38
我想通了。在版本3中,有一个类型说明符,缺省为"text",对于需要html的每一列,需要将其设置为"html“。
$('.table').footable({
"columns": [{
"type": "text"
},{
"type": "html"
},{
...
}]
});有效类型为"text“、"html”、"number“和"date”
https://stackoverflow.com/questions/41539203
复制相似问题