【问题标题】:DataTables place search and entries filter under the table?DataTables 在表下放置搜索和条目过滤器?
【发布时间】:2011-12-02 11:27:54
【问题描述】:

我可以将显示整体过滤器放在表格下方而不是表格上方的搜索过滤器中吗?

见:http://datatables.net/release-datatables/examples/basic_init/alt_pagination.html

而且我知道我可以放置 een position : absolute 之类的东西,但我想把这些东西的 HTML 代码放在桌子下面。

【问题讨论】:

    标签: jquery datatable


    【解决方案1】:

    找到解决方案:

    "sDom": 't<plf>'
    
    This initialisation variable allows you to specify exactly where in the DOM you want DataTables to inject the various controls it adds to the page (for example you might want the pagination controls at the top of the table). DIV elements (with or without a custom class) can also be added to aid styling. The follow syntax is used:
    The following options are allowed:
    
    'l' - Length changing
    'f' - Filtering input
    't' - The table!
    'i' - Information
    'p' - Pagination
    'r' - pRocessing
    The following constants are allowed:
    'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')
    'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')
    The following syntax is expected:
    '<' and '>' - div elements
    '<"class" and '>' - div with a class
    '<"#id" and '>' - div with an ID
    Examples:
    '<"wrapper"flipt>', '<lf<t>ip>'
    

    【讨论】:

      【解决方案2】:

      将你的 Div 放在任何你想要的地方

      $('div.dataTables_filter').appendTo("#filterdata");
      
      <div id="filterdata">
      
      </div>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-12-09
        • 1970-01-01
        • 2018-04-19
        • 2014-10-12
        • 1970-01-01
        • 2013-02-19
        • 2014-11-22
        • 2011-12-22
        相关资源
        最近更新 更多