【问题标题】:footable, how to display "sorted" icon after the loading of the page?footable,如何在页面加载后显示“排序”图标?
【发布时间】:2017-01-07 09:34:56
【问题描述】:

我使用出色的“footable”插件。我可以通过单击标题对表格进行排序,但是如何告诉“footable”:在页面加载后使用此列对表格进行排序?

我尝试使用这个关键字:data-sort-initial,但没有成功:

 <thead>
                    <tr>
                        <th data-type="html" data-sort-use="text" data-sort-initial="ascending">Code</th>
                        <th>Libellé</th>

                    </tr>
                </thead>

我的目标是在加载后拥有这张桌子:

在标题中显示“排序图标”。怎么做 ?

我的 js 很简单:

$(function () {
    $('.footable').footable();
});

感谢您的想法。谢谢

多米尼克

【问题讨论】:

    标签: footable


    【解决方案1】:

    找到答案。

    <th data-type="html" data-sort-use="text" data-sorted="true" data-direction="ASC">Code</th>
    

    【讨论】:

      【解决方案2】:

      您必须在列中添加标签:data-sorted="true"

      像这样:

      <th data-type="html" data-sort-use="text" data-sort-initial="ascending" data-sorted="true">Code</th>
      

      【讨论】:

      • 这个在后来的 FooTable 版本中对我有用。谢谢!
      猜你喜欢
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多