首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >footable v3不会在行中显示按钮元素

footable v3不会在行中显示按钮元素
EN

Stack Overflow用户
提问于 2017-01-09 07:50:39
回答 1查看 1.4K关注 0票数 1

我在Footable版本3(用于Bootstrap)中遇到了一个问题,这个问题在版本2中没有出现。按钮元素短暂地出现,然后完全消失(在HTML中,只剩下按钮的文本-标签被删除了!)。有没有办法绕过这个问题(潜在的bug)?文档中没有提到这一点。

代码语言:javascript
复制
<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>

和标题(也许脚本顺序是错误的-尽管它会调整大小)

代码语言:javascript
复制
    <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格式的源代码时(请注意,按钮元素完全缺失):

代码语言:javascript
复制
<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>

不管怎样-想要解决这个问题让我抓狂

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-01-09 08:50:38

我想通了。在版本3中,有一个类型说明符,缺省为"text",对于需要html的每一列,需要将其设置为"html“。

代码语言:javascript
复制
$('.table').footable({
    "columns": [{
        "type": "text"
    },{
        "type": "html"
    },{
        ...
    }]
});

有效类型为"text“、"html”、"number“和"date”

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41539203

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档