首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >footable js移除表中的所有表单元素。

footable js移除表中的所有表单元素。
EN

Stack Overflow用户
提问于 2016-10-31 14:53:18
回答 1查看 870关注 0票数 2

我在可引脚的jquery库的帮助下实现了一个响应表。现在我已经放置了输入标签,选中了它。Footable js移除所有这些标记,并使其成为空<td>

代码语言:javascript
复制
<table id="accordion-example-1" class="table" data-paging="true" data-filtering="false" data-sorting="false">
  <thead>
    <tr>
        <th></th>
        <th data-breakpoints="xs">Date Created</th>
        <th>Source</th>
        <th>Type</th>
        <th data-breakpoints="xs">Status</th>
        <th data-breakpoints="xs sm">&nbsp;</th>
        <th data-breakpoints="xs sm md" >&nbsp;</th>
        <th data-breakpoints="xs sm md">&nbsp;</th>
    </tr>
  </thead>
  <tbody>
    <tr data-expanded="true">
        <td></td>
        <td>6/11/16</td>
        <td>Mr. Cooper - Request Info</td>
        <td>Buying</td>
        <td>
            <select class="nobrdr">
                <option>Offer</option>
            </select>
        </td>
        <td><input type="text" class="nobrdr" placeholder="Value"/></td>
        <td><input type="text" class="nobrdr" placeholder="Date" /></td>
        <td><button class="nobrdr m-l-1" type="button" ><b>+ Add</b></button><br>Forms/Docs</td>
    </tr>

  </tbody>
</table>

jquery函数:

代码语言:javascript
复制
$(function($){
            $('#accordion-example-1,#accordion-example-2').footable({

            });
        });
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-10-31 15:07:17

您需要将表单元素所在的列的数据类型更改为" HTML ",否则FooTable假设该列只包含文本并将其格式化--也就是说,它将从单元格内容中删除所有的HTML标记,而不仅仅是表单元素。

例如,在您的案例中:

代码语言:javascript
复制
<th data-type="html" data-breakpoints="xs">Status</th>

将告诉它尊重状态列中任何单元格中的HTML标记。

可能支持的列类型是"text“、"number”、"html“和"date”。如果没有指定类型,则默认为"text“。

关于更详细的讨论,我建议您阅读http://fooplugins.github.io/FooTable/docs/getting-started.html的指南,并找到“列选项”部分。

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

https://stackoverflow.com/questions/40344712

复制
相关文章

相似问题

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